I have several of the same settings for VDS Ubuntu 16.04. On the first login as root in the SHH-client (Putty) I type

root@local:~# mysql 

and enter this DBMS without entering a password.

On other VDS in the same way is not included in mysql - writes:

 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 

If you enter

 mysql -u root -p 

and then type the password mysql-root, then enters.

Answer: Why do I need to enter a password on other VDS, but not on the first?

PS On all VDS root-ubuntu and root-mysql passwords are different.

  • one
    “The same settings” - obviously, not the same) - andreymal
  • one
    Look at the contents of the mysql.user tables on each server, especially the column with plugins - andreymal
  • 1) The settings on the VDS are exactly the same (for a carbon copy). 2) Both here and there for all users in the mysql.user tables is "mysql_native_password" in the plugin field - Ruport
  • 3) for root-mysql users, the host field is set to "localhost" - Ruport

1 answer 1

Found the reason: Previously changed the password root-mysql. Therefore, to log into mysql in the console without entering a password, the root-mysql password must be entered here: /root/.my.cnf