I used CentOs5.5 when learning Linux. In this environment, there are many ways to install Mysql. Below I will only talk about the method that I succeeded this time as a record, for your reference, and make a note for yourself.
MySQL download
1. Enter the URL: http://dev.mysql.com/downloads/mysql/
2. In the URL, follow the instructions on the system platform. Because I use 32 bits, I downloaded 32-bit.
After the download is complete, copy it to the/usr/local directory of our virtual machine and double-click it to decompress the package (I do not know why the command is incorrectly decompressed ).
After decompression, you will find a file,
Although there are many files, what we really need is the two installation packages enclosed in blue boxes.
MySQL installation and troubleshooting
In the preceding two files, we must first install the server and install the client.
1. First enter the command to install the server:
2. After the server is successfully installed, enter the command to install the client:
3. after both of them have been installed successfully, mysql has no password. If the service is enabled, enter mysql-uroot-p directly, then press Enter to Enter, but after installation, I found that this is not the case, and there is still a problem of login failure.
mysql-->ERROR (): Access denied user @ ( password: NO)
Therefore, we need to modify the mysql configuration, so input to terminate the mysql service.
4. Enter the following command:
5. After the fourth statement is executed, note that mysql is not displayed before.>
Exit mysql
And then enter the password we just modified to access mysql.
ERROR (HY000): You must SET PASSWORD before executing statement
This is a very strange problem. When I log in with a password, I still ask for a password. For more information, see http://dev.mysql.com/doc/refman/5.6/en/alter-user.html. After performing the following operations, you will be OK:
1. After executing the statement, we can use the mysql statement normally.