After MySQL is installed, there is a default root user, and the password is blank. However, I cannot log on to the terminal. When I use root to log on to MySQL, # sudo MySQL
-U root-P returns the following error: Error 1045 (28000): Access denied for user
'Root' @ 'localhost' (using password: Yes ).
Fix:
On the terminal, enter sudo gedit/etc/MySQL/Debian. CNF. The following content should be displayed:
# Automatically generated for Debian scripts. Do not touch!
[Client]
Host = localhost
User = Debian-sys-Maint
Password = 123456 (I wrote the password here)
Socket =/var/run/mysqld. Sock
[Mysql_upgrade]
User = Debian-sys-Maint
Password = 123456
Socket =/var/run/mysqld. Sock
Basedir =/usr
After finding this, open the terminal and enter: sudo mysql-u Debian-sys-Maint-P
Then you will be asked to enter the password, enter the password in your file (after the password), and then you can enter.
For MySQL administrator
Enter localhost In the hostname option, enter the user name Debian-sys-Maint in your file in username, and then copy the password to it,
You can log on. As for the root user, you can change the password of the root user after entering the graphic interface.
If you use PMA (phpMyAdmin) to manage MySQL, the added account and password should also be.