MariaDB 數(shù)據(jù)庫管理系統(tǒng)是 MySQL 的一個分支,主要由開源社區(qū)在維護,采用 GPL 授權(quán)許可。開發(fā)這個分支的原因之一是:甲骨文公司收購了 MySQL 后,有將 MySQL 閉源的潛在風(fēng)險,因此社區(qū)采用分支的方式來避開這個風(fēng)險。MariaDB完全兼容mysql,使用方法也是一樣的。
系統(tǒng)環(huán)境:
CentOS Linux release 8.1.1911 (Core)
1)安裝 mariaDB
2)開啟服務(wù)。安裝完成后首先要把MariaDB服務(wù)開啟,并設(shè)置為開機啟動
systemctl start mariadb # 開啟服務(wù)
systemctl enable mariadb # 設(shè)置為開機自啟動服務(wù)
3)初次配置。
mysql_secure_installation
Enter current password for root (enter for none): # 輸入數(shù)據(jù)庫超級管理員root的密碼(注意不是系統(tǒng)root的密碼),第一次進入還沒有設(shè)置密碼則直接回車
Set root password? [Y/n] # 設(shè)置密碼,y
New password: # 新密碼
Re-enter new password: # 再次輸入密碼
Remove anonymous users? [Y/n] # 移除匿名用戶, y
Disallow root login remotely? [Y/n] # 拒絕root遠程登錄,n,不管y/n,都會拒絕root遠程登錄
Remove test database and access to it? [Y/n] # 刪除test數(shù)據(jù)庫,y:刪除。n:不刪除,數(shù)據(jù)庫中會有一個test數(shù)據(jù)庫,一般不需要
Reload privilege tables now? [Y/n] # 重新加載權(quán)限表,y?;蛘咧貑⒎?wù)也許
4)測試是否能登錄成功。
5)設(shè)置MariaDB字符集為utf-8
。。。。。。
6)遠程鏈接mariadb數(shù)據(jù)庫
開啟遠程訪問權(quán)限
grant all on *.* to user03@'%' identified by '123456' with grant option
強制刷新權(quán)限
到此這篇關(guān)于CentOS 8 安裝 MariaDB的詳細教程的文章就介紹到這了,更多相關(guān)CentOS 8 安裝 MariaDB內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!