centos 6 安装mysql
只要注意一点,下载的mysql是不是el6的,别用el7的就行
wget https://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-5.6.35-1.el6.x86_64.rpm-bundle.tar
tar -xvf MySQL-5.6.35-1.el7.x86_64.rpm-bundle.tar
rpm -qa | grep -i mysql
发现
MySQL-client-5.6.35-1.el6.x86_64
mysql-libs-5.1.73-8.el6_8.x86_64
mysql80-community-release-el7-3.noarch
所以
rpm -e --nodeps mysql-libs-5.1.73-8.el6_8.x86_64
rpm -e --nodeps mysql80-community-release-el7-3.noarch
然后
rpm -ivh MySQL-server-5.6.35-1.el6.x86_64.rpm
rpm -ivh MySQL-client-5.6.35-1.el6.x86_64.rpm
停止服务
service mysql stop
安全模式启动
mysqld_safe --user=mysql --skip-grant-tables --skip-networking
登录mysql
mysql -u root mysqlUPDATE user SET Password=PASSWORD('root') where USER='root';
set global read_only=0;
flush privileges;