First, after sudoapt-getinstallmysql-servermysql-client is installed, the mysql service starts to run. You need to change the root password, but this problem often occurs.
First, after sudo apt-get install mysql-server mysql-client is installed, the mysql service starts to run. You need to change the root password, but this problem often occurs.
First, sudo apt-get install mysql-server mysql-client
After the installation is complete, the mysql service starts to run. You need to change the root password, but this situation often occurs.
'Access denied for user' root' @ 'localhost' (using password: YES) 'or other situations that cause logon Failure to mysql. Here we can solve the problem by following the steps below:
1. Open the/etc/mysql/debian. cnf file and store the related password.
Sudo gedit/etc/mysql/debian. cnf
In the [client] segment, there are user = and password =. This is what we need.
2. Enter the command: mysql-udebian-sys-maint-p
Debian-sys-maint is debian. content following user = in cnf. after you press enter, you will be prompted to enter the password. copy and paste the content after password =, and press enter to start the mysql console. (generally, do not press the password. It is prone to errors. Copy the password)
3. After Entering the console, follow these steps:
Use mysql;
Update user set password = PASSWORD ('new password') where user = 'root ';
Flush privileges;
In this case, you can enter quit; log out with the root account, or continue other operations
Uninstall mysql: sudo apt-get remove mysql-server mysql-client
Sudo apt-get autoremove