原文:https://blog.csdn.net/pengjunlee/article/details/81212250
1、卸載mariadb
1)查看mariadb
[root@localhost ~]# rpm -qa|grep mariadb
mariadb-libs-5.5.52-1.el7.x86_64
2)卸載
rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64
2锋谐、下載并安裝mysql
1)下載安裝包
進(jìn)入并創(chuàng)建安裝目錄 mkdir /var/mysql
*下載安裝包
?wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
*安裝mysql
rpm -ivh mysql-community-release-el7-5.noarch.rpm
安裝完成之后遍尺,會(huì)在 /etc/yum.repos.d/ 目錄下新增 mysql-community.repo 、mysql-community-source.repo 兩個(gè) yum 源文件
yum install mysql-server
檢查mysql是否安裝成功
rpm -qa | grep mysql
*啟動(dòng)/停止/重啟mysql
systemctl start/stop/restart mysqld
設(shè)置開(kāi)機(jī)自啟動(dòng)
systemctl enable mysqld
2)配置
復(fù)制配置文件到/etc/my.cnf中
cp /support-files/my-default.cnf /etc/my.cnf
設(shè)置表名不區(qū)分大小寫(xiě)?
在[mysql]節(jié)點(diǎn)下添加 lower_case_table_names=1,再重啟mysql ,systemctl restart mysqld
3)添加遠(yuǎn)程用戶(hù)
grant all privileges on *.* to admin@"%" identified by 'something' with grant option;
添加了一個(gè)賬號(hào)admin涮拗,密碼something的遠(yuǎn)程用戶(hù)
執(zhí)行 flush privileges乾戏;