Experience in installing MySQL in red-flag Linux

Source: Internet
Author: User
I have been in the company for a while and am currently responsible for the database design and development of the project. A few days ago, I encountered a problem where MySQL could not be installed on red-flag Linux. Use the rmp command to install M

I have been in the company for a while and am currently responsible for the database design and development of the project. A few days ago, I encountered a problem where MySQL could not be installed on red-flag Linux. Use the rmp command to install M

I have been in the company for a while and am currently responsible for the database design and development of the project. A few days ago, I encountered a problem where MySQL could not be installed on red-flag Linux.

When you install MySQL5.1 using the rmp command, the following ERROR occurs: 1062 Duplicate entry 'localhost-'for primary key, indicating that an ERROR is encountered during installation. Enter mysql-uroot p123 but cannot enter mysql. A Password error is prompted. Run the command bin/safe_mysqld -- skip-grant-tables & to enter mysql. Then, check the user table under mysql and find that there is no mysql user information in it. This means that the user information was not initialized when mysql was installed, but the cause was not found. Later, I guess it may be a problem with the linux system, And I consulted a database master of the company. I didn't expect it to be solved in 2 minutes.

It turns out that there is a problem if mysql is installed under root @ localhost, And the mysql user is not initialized after installation. The specific cause is unknown. But there are solutions:

Run vi/etc/hosts to add a line of information, such as 192.168.0.66 XXDB. The IP address must be the real IP address of this linux instance, and then save and restart linux. There is no problem when installing mysql under root @ XXDB.

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.