1.配置yum源:mysql
在MariaDB官網提供了yum源在線生成器,選擇合適的系統和版本後,會生成所需的repo文件內容:sql
在/etc/yum.repos.d/目錄下新建一個MariaDB.repo文件,將上面的內容保存進去:數據庫
2.安裝MariaDB安全
使用rpm 命令查看已安裝的mysql包並卸載:spa
安裝mariadb:3d
切換到普通用戶下,執行sudo yum install MariaDB-server MariaDB-client進行安裝server
(若是使用sudo執行安裝命令提示*** is not in the sudoers file之類的錯誤,修改/etc/sudoers這個文件以下blog
保存並退出便可。能夠用whereis sudoers命令查找你的系統sudoers文件位置)it
須要安裝的包列表:mariadb
3.安裝結束後:
4.啓動和鏈接到mysql
5.關於安裝過程當中的端口號、用戶名、密碼
根據官網QA:
Default port is 3306. If you installed a new database (rather than upgraded an
old one), you will have a 'root' account with an empty password. After starting
the server you should be able to connect to it by running 'mysql -uroot'
可知默認的端口是3306,新安裝的mariadb默認帳戶是root,密碼爲空,服務啓動後能夠使用'mysql -uroot'來鏈接到數據庫。
6.安裝目錄結構
數據庫目錄:/var/lib/mysql/
配置文件:/usr/share/mysql(mysql.server命令及配置文件)
相關命令:/usr/bin(mysqladmin、mysqldump等命令)(*mysql的一種安全啓動方式:/usr/bin/mysqld_safe --user=root &)
啓動腳本:/etc/rc.d/init.d/