First go to http://dev.mysql.com/downloads/mysql/5.5.html#downloads site Download:
Download the following three files separately (since my machine is 32 bits, below is the 32-bit version of the package, if your machine is 64-bit, please download the 64-bit version):
mysql-server-5.5.16-1.rhel5.i386.rpm
mysql-client-5.5.16-1.rhel4.i386.rpm
mysql-devel-5.5.16-1.rhel4.i386.rpm
Use the wget command to download the three files using a breakpoint transfer
Wget-c http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-server-5.5.16-1.rhel4.i386.rpm/from/http://mysql.spd.co.il/
Wget-c http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-client-5.5.16-1.rhel4.i386.rpm/from/http://mysql.spd.co.il/
Wget-c http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-devel-5.5.16-1.rhel4.i386.rpm/from/http://mysql.spd.co.il/
The above three files, I am in the installation of time, download very slow, below provide a cloud disk share address:
http://pan.baidu.com/s/1c0kxN0k
(The above address needs to be manually copied and pasted into the browser enter the open)
Start the installation after the download is complete:
RPM-IVH mysql-server-5.5.16-1.rhel4.i386.rpm mysql-client-5.5.16-1.rhel4.i386.rpm mysql-devel-5.5.16-1.rhel4.i386.rpm
After the installation is complete, enter MySQL to see if the installation is successful.
Mysql
If the following error message appears:
ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)
Description MySQL service has not started, input service MySQL start start MySQL service
Service MySQL Start
Then enter MySQL, if prompted with the following message, indicating success.
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 1
Server version:5.5.16 MySQL Community Server (GPL)
Copyright (c), +, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
When you first install, the default password is blank, you can use the following command to modify the root password,
mysqladmin-u root password mypassword
mypassword The new password you set for you
Then log in again
Mysql-u root–p
RPM package installed MySQL is not installed/etc/my.cnf files, the solution, only need to copy the/usr/share/mysql directory my-huge.cnf files to/etc directory, and renamed to MY.CNF can
Cp/usr/share/mysql/my-huge.cnf/etc/my.cnf
Configure remote Access
For security reasons, MySQL does not allow remote access by default, you can use the following to turn on remote access
Give any host access to data
Mysql>grant all privileges on * * to ' root ' @ '% ' with GRANT OPTION
Make the changes effective
Mysql>flush Privileges
If the remote access is still not possible, it is likely that the firewall, you can open the firewall 3306 port or simply shut down the firewall.
The above is a summary of their first installation of MySQL on the CentOS, I hope to be helpful to everyone.
Installing MySQL5.5 in RPM under CentOS