Solution for failure to log on to mysql in Ubuntu7.10

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.