centeos7安装mariadb
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                centeos7安装mariadb
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.                        
                                1 centeos7安裝mariadb
yum -y install mariadb mariadb-server
2 啟動mariadb服務
systemctl start mariadb.service
systemctl enable mariadb.service
3 配置
執(zhí)行mysql_secure_installation
1首先提示輸入密碼:
Enter current password for root (enter for none):<–初次運行直接回車
?
2設置密碼 Set root password? [Y/n] <– 是否設置root用戶密碼,輸入y并回車或直接回車New password: <– 設置root用戶的密碼
Re-enter new password: <– 再輸入一次你設置的密碼 3其它配置 Remove anonymous users? [Y/n] <– 是否刪除匿名用戶,回車
Disallow root login remotely? [Y/n] <–是否禁止root遠程登錄,回車,
Remove test database and access to it? [Y/n] <– 是否刪除test數(shù)據(jù)庫,回車
Reload privilege tables now? [Y/n] <– 是否重新加載權限表,回車 配置完成后,執(zhí)行mysql -uroot -ppassword測試登錄。其中root為要登錄的用戶名,password為剛才設置的root用戶的密碼 如果需要開啟root的遠程登錄用于實驗等環(huán)境則首先ssh進入數(shù)據(jù)庫 mysql -uroot -ppassword use mysql; select host,user,password from user;<-查看表中有沒有一條這樣的記錄
| ::1 | root |
如果有上述記錄直接
update user set host='%' where host='::1';
flush privileges;
即可打開root遠程登錄(不適用生產環(huán)境)
?
如果沒有上述記錄則執(zhí)行
grant all privileges? on *.* to root@'%' identified by "password";
flush privileges;
轉載于:https://www.cnblogs.com/WaterGe/p/11257382.html
總結
以上是生活随笔為你收集整理的centeos7安装mariadb的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: 1108. Defanging an I
 - 下一篇: python元类深入理解