MariaDB,它全面兼容了Mysql
注意:Mysql8有些字符集編碼,MariaDB不支持,參考網(wǎng)上改了好久仍然有錯(cuò),所以后來我又卸載改回Mysql了
安裝
-
數(shù)據(jù)包
鏈接:https://pan.baidu.com/s/1-OkqhVD4yEh4JU-4k8nGZQ 提取碼:e3ms
官網(wǎng)原地址 http://yum.mariadb.org/10.4/centos7-amd64/rpms/
//三個(gè)命令安裝依賴的環(huán)境包
#yum install rsync nmap lsof perl-DBI nc
?
#rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm
?
#rpm -ivh jemalloc-devel-3.6.0-1.el7.x86_64.rpm
?
//檢查有沒有mariadb-libs-5.5.65-1.el7.x86_64,有的話刪掉
#rpm -qa | grep mariadb-libs
//刪除
#rpm -ev --nodeps mariadb-libs-5.5.65-1.el7.x86_64
//再檢查一遍
#rpm -qa | grep mariadb-libs
?
//galera環(huán)境
#yum install boost-devel.x86_64
//解決上一個(gè)install出現(xiàn)的warning
#rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB
?
//安裝5個(gè)包
#rpm -ivh MariaDB-common-10.4.17-1.el7.centos.x86_64.rpm MariaDB-compat-10.4.17-1.el7.centos.x86_64.rpm MariaDB-client-10.4.17-1.el7.centos.x86_64.rpm galera-4-26.4.4-1.rhel7.el7.centos.x86_64.rpm MariaDB-server-10.4.17-1.el7.centos.x86_64.rpm
?
配置
//啟動(dòng)
//service mysql start不好使了,參考
//https://blog.csdn.net/qq_38286347/article/details/85060407?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.not_use_machine_learn_pai&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromBaidu-2.not_use_machine_learn_pai
?
//第一步,啟動(dòng)服務(wù)
# systemctl start mariadb.service //啟動(dòng)服務(wù)
?
//加入開機(jī)服務(wù)
# systemctl enable mariadb.service //開機(jī)啟動(dòng)服務(wù)
?
//打開安全配置
# mysql_secure_installation
?
//輸入當(dāng)前的密碼,不過現(xiàn)在還沒有密碼,提示后,直接回車
//彈出,switch to unix_socket authentication[y/n]
#n
//change the root password?[y/n]
#y
輸入密碼123456
//remove anonymous users?[y/n]
#y
//Disallow root login remotely?[y/n]
#n
//remove test database and access to it?[y/n]
#y
//reload privilege tables now?[y/n]
#y
//thanks for using MariaDB--安裝成功了
遠(yuǎn)程連接配置
//登錄,進(jìn)入mysql命令行
#mysql -u root -p
?
//賦予用戶遠(yuǎn)程連接的權(quán)限
#grant all privileges on *.* to 'root'@'%' identified by 'root密碼';
#flush privileges;