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.