1. Check whether other MySQL versions are included in the system. The command is as follows:
# Rpm-Qa | grep MySQL
If you have this software, uninstall it with rpm-E. The command is as follows:
# Rpm-e MySQL ***** (the name found above)
If you are prompted that some dependencies cannot be deleted during the deletion process, use the following command:
# Rpm-e -- nodeps MySQL *****
2. Download the RPM package from the official MySQL website. Select different RPM packages (including server and client packages) based on the CPU model and RedHat version of your server. The address is as follows:
Http://dev.mysql.com/downloads/mysql/5.0.html
3. Add users and user groups in RedHat. The command is as follows:
# Groupadd MySQL
# Useradd-G MySQL
4. Place the downloaded file in a directory of RedHat and run the command to install the RPM package of the server and client respectively. The command is as follows:
# Rpm-IVH MySQL-server-community-5.0.67-0.rhel4.i386.rpm
# Rpm-IVH MySQL-client-community-5.0.67-0.rhel4.i386.rpm
5. Modify the password of the root user:
# Killall mysqld
# Mysqld_safe -- user = MySQL -- skip-grant-tables -- skip-Networking &
# Mysql-u root MySQL
Mysql> Update user SET Password = PASSWORD ('newpassword') where user = 'root ';
Mysql> flush privileges;
Mysql> quit
6. Modify the remote access permission of the root user:
# Killall mysqld
# Mysqld_safe -- user = MySQL &
# Mysql-u root-P MySQL
Enter Password: (enter the new password modified in step 1)
Mysql> grant all privileges on *. * To 'root' @ '%' identified by 'root' with grant option;
Mysql> flush privileges;
Mysql> quit