Software download
Take CentOS 64-bit, mysql5.5 as an example.
Download mysql5.5 website:http://dev.mysql.com/downloads/mysql/5.5.html#downloads
Download the three files that the arrows refer to
Uninstall the MySQL that is already installed
1. Find out if MySQL was previously installed
Command: Rpm-qa|grep-i MySQL
You can see the following as shown:
2. Stop the MySQL service, delete the previously installed MySQL
Delete command: Rpm-e–nodeps package name
3, find the old version of MySQL directory, and delete the old version of MySQL files and libraries
Find/-name MySQL
Delete the corresponding MySQL directory
4. Manually delete/etc/my.cnf
Rm-rf/etc/my.cnf
5. Find out if the machine installs MySQL again
Rpm-qa|grep-i MySQL
No results, instructions have been uninstalled thoroughly, next install MySQL directly
Install MySQL
Go to the file directory after downloading.
Installing Devel
Installing the server
See the information to prove the installation was successful
Install Client
Start MySQL
Set Login Password
MySQL does not have a password by default
1. Command
usr/bin/mysqladmin-u root password ' new-password '
Format: Mysqladmin-u username-P Old password password new password
2. Example
Example 1: Add a password to root 123456.
Type the following command:
[Email protected] local]#/usr/bin/mysqladmin-u root password 123456
Note: Because Root does not have a password at the beginning, the-p old password can be omitted.
Linux installation MySQL