2.将下载的MysqL-5.6.33-1.el7.x86_64.rpm-bundle.tar文件上传到centos,并解压:
tar -xvfMysqL-5.6.33-1.el7.x86_64.rpm-bundle.tar
3.执行
rpm -ivh MysqL-server-5.6.33-1.el7.x86_64.rpm
4.验证MysqL server是否安装成功:
rpm -e mariadb-libs-5.5.50-1.el7_2.x86_64
5.如果出现未安装软件包MysqL-server-5.6.33-1.el7.x86_64.rpm则需要检查mariadb是否安装
5.1 获取mariadb的基本信息:
rpm -qa |grepmariadb
5.2 用获取的mariadb信息进行mariadb的卸载:
rpm -e --nodeps mariadb-libs-5.5.50-1.el7_2.x86_64
5.3 再次验证mariadb是否卸载:
rpm -qa |grep mariadb
6.重新安装MysqL:
rpm -ivh MysqL-shared-compat-5.6.33-1.el7.x86_64.rpm # RHEL兼容包
SET PASSWORD FOR 'root'@'localhost'=PASSWORD('root'); #在MysqL命令行中设置root的密码为root
附:
#
service MysqL stop;
MysqL>
UPDATE user SET Password=PASSWORD('root') where USER='root';
MysqL>
FLUSH PRIVILEGES;
MysqL>
quit;
#
service MysqL restart
验证: #
MysqL -uroot -p
Enter password: <输入新设的密码
root>
#
service MysqL stop;
MysqL-client-5.6.33-1.el7.x86_64
MysqL-shared-compat-5.6.33-1.el7.x86_64
MysqL-devel-5.6.33-1.el7.x86_64
MysqL-server-5.6.33-1.el7.x86_64
MysqL-shared-5.6.33-1.el7.x86_64