I have installed Ubuntu7.10 Server Edition and desktop edition. The server version directly configures the LAMP server and the desktop version. I use the new software Manager-edit-to use the Task Group tag software package. Select LAMP for installation. In bash, the following error is returned when you use root to log on to mysql; # mysql-uroot-p. ERROR1045 (28000): Accessdeniedforuser 'root' @ 'localhost'
I have installed Ubuntu7.10 Server Edition and desktop edition. The server version directly configures the LAMP server and the desktop version. I use the new software Manager-edit-to use the Task Group tag software package. Select LAMP for installation.
In bash, the following ERROR is returned when you use root to log on to mysql; # mysql-u root-p: ERROR 1045 (28000 ): access denied for user 'root' @ 'localhost' (using password: yes ).
What should I do?
The solution is as follows:
1. Open the/etc/mysql/debian. cnf file and use gedit on the desktop. Use vim on the server to record the username and password provided in the [client] section in the file:
Mysql-u debian-sys-maint-p
Enter password: <Enter the password for the [client] section>
Mysql> use mysql;
Mysql> UPDATE user SET Password = PASSWORD ('newpwd') where User = 'root ';
Mysql> quit
'Newpwd' is the new root password.
Log on to the root account again.