Centos5无需换yum源安装mysql

1、关闭防火墙
service iptables stop
chkconfig iptables off

2、创建目录
mkdir mysql
3、进入目录
cd mysql
4、下载mysql包
curl -o MySQL-5.5.45-1.rhel5.x86_64.rpm-bundle.tar https://cdn.mysql.com/archives/mysql-5.5/MySQL-5.5.45-1.rhel5.x86_64.rpm-bundle.tar
5、解压mysql包
tar -xvf MySQL-5.5.45-1.rhel5.x86_64.rpm-bundle.tar
6、安装MySQL
rpm -ivh MySQL-client-5.5.45-1.rhel5.x86_64.rpm MySQL-devel-5.5.45-1.rhel5.x86_64.rpm MySQL-server-5.5.45-1.rhel5.x86_64.rpm – -force – -nodeps

7、启动mysql
service mysql start

8、停止mysql
service mysql stop

9、重启mysql
service mysql restart

10、添加mysql开机自启
chkconfig mysql on

11 、mysql -uroot -p -A

12、grant all privileges on *.* to ‘root’@’%’ identified by ‘123456’ with grant option;

13、FLUSH PRIVILEGES;

14、exit