如何在centos7安裝mariadb數(shù)據(jù)庫(kù)
2017-04-10 02:28:53
13647
a:把之前安裝了mysql-community數(shù)?庫(kù)先刪除掉!
#rpm -qa | grep mysql
#yum remove mysql*
#rm -rf /var/lib/mysql
b:執(zhí)行命令安裝mariadb
#yum install mariadb mariadb-server -y
c:安裝好之后設(shè)置啟動(dòng)
#systemctl start mariadb.service
#systemctl enable mariadb.service #注意在執(zhí)行開(kāi)機(jī)自啟動(dòng)時(shí)出錯(cuò)是因?yàn)闆](méi)有設(shè)置密碼
d:剛剛安裝的mariadb是沒(méi)有密碼的
e:設(shè)置密碼
MariaDB[(none)]>update mysql.user set password=password(‘密碼’) where user=”root”;
MariaDB[(none)]>flush privileges;
f:修改密碼之后在來(lái)執(zhí)行讓mariadb開(kāi)機(jī)自啟動(dòng)就不會(huì)出錯(cuò)了
#systemctl enable mariadb.service
會(huì)員登錄
賬號(hào)登錄還沒(méi)有賬號(hào)?立即注冊(cè)