Home > database >  Help: sometimes under Linux mysql -u root can directly from dense land sometimes not
Help: sometimes under Linux mysql -u root can directly from dense land sometimes not

Time:09-29

Company needs, their learning in the Linux virtual machine installed several mysql, but found that sometimes installed using mysql -u root can directly from dense, sometimes not, cannot login will report the ERROR 1045 (28000) : Access denied for user 'root' @ 'localhost' (using password: NO) ERROR, doubt is mysql can set the mysql -u root from operation, but baidu did not see have a relevant question, please give directions, who have to understand

CodePudding user response:

If it is not the same machine the same command database login password impossible sometimes can sometimes cannot login

See the select the database user, host, password from mysql. The user;

CodePudding user response:

Set the root password will be required to enter your password
Mysql -u root -p set password library name
This is ok, if you want to save trouble, can be set up under the home directory. My. CNF file
[client]
User=root
Password=set password
So you can directly use the mysql login
  • Related