D
D
Denis Denis2015-06-29 14:41:35
linux
Denis Denis, 2015-06-29 14:41:35

When accessing mysql on the server, it writes an error. What's wrong?

Enter: mysql
error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
I understand that there is no access. And who then has it, if I logged in as root?
How then to do this? /etc/init.d/mysql stop
Something it doesn't google ((

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Azazel PW, 2015-06-29
@golovewkin

System access and SQL access are two different things.
Try typing the command like this:
mysql -u root -p
And it will ask for the user's password.
And you try to log in without a password
mysql -u root
If the password does not fit, then you can reset it.
/etc/init.d/mysqld stop
/usr/bin/mysqld_safe --skip-grant-tables --user=root &
mysql -u root
UPDATE mysql.user SET Password=PASSWORD(`newpassword`) WHERE User=`root `;
FLUSH PRIVILEGES;
exit
/etc/init.d/mysqld restart

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question