Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question