I want to develop a database on the Ubuntu7.10 platform. I saw on the Ubuntu Forum that mysql installation was quite simple, so I chose mysql. I did not expect that I had spent two days on this simple problem. It seems that the simplicity of things varies from person to person. Now, let's go to the question!
After I installed mysql5.0 on the Ubuntu7.10 terminal, I installed Mysql Administrator with the xinlide Software Package Manager. After the installation, the problem came out. Many people have said that after mysql is installed, there is a default root user, and the password is empty. 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 ).
If you want to use Mysql Administrator to log on, you have to enter the Server Hostname option. I don't know what it is. I searched Baidu for nothing for a day. However, I accidentally discovered the debian. cnf file in the/etc/mysql/directory, and double-click it directly, but it cannot be opened. So I entered sudo gedit/etc/mysql/debian. cnf on the terminal to enable it. 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.
As for Mysql Administrator, you can enter localhost In the Server Hostname option, enter the Username in your file in Username, and copy the password to it to log on. As for the root user, you can change the password of the root user after entering the graphic interface.
My personal experience may help you.