Mysql的基本應用之MariaDB裝置辦法詳解。本站提示廣大學習愛好者:(Mysql的基本應用之MariaDB裝置辦法詳解)文章只能為提供參考,不一定能成為您想要的結果。以下是Mysql的基本應用之MariaDB裝置辦法詳解正文
我初次用mysql是在ubuntu上,如今用的是linux 中的Red Hat 分支的centOS 7 ,裝置時發明平日用的都是MariaDB 來取代mysql,經由過程材料查詢發明Mariadb是mysql的個中的一種分支,由mysql的開創人率領的團隊所開辟的mysql分支的一種版本,由於mysql遭到被Oracle收買後的日漸關閉與遲緩的更新,浩瀚Linux刊行版逐步擯棄了這小我氣開源數據庫,使MySQL在各年夜Linux刊行版中的掉勢因為不滿MySQL被Oracle收買後的日漸關閉與遲緩的更新,浩瀚Linux刊行版逐步擯棄了這小我氣開源數據庫,而轉向了MariaDB,固然PostgreSQL一向被看成MySQL的直接競爭敵手,但是真正賜與其致命一擊的仿佛更像是MariaDB,而今後給Mysql致命一擊的也將是MariaDB。
言歸正傳,我們來詳細講講MariaDB ,其實MariaDb的操作與Mysql的操作根本一樣,只是基於Mysql停止了機能的晉升,今朝MariaDB的更新速度曾經遠遠超出了Oracle團隊的速度,究竟是Mysql開創人率領的團隊,怎樣不讓人寧神。
MariaDb的裝置
linux下 經由過程
yum install mariadb mariadb-server #訊問能否要裝置,輸出Y便可主動裝置
mariaDBde 辦事的根本敕令
[root@127 ~]# systemctl start mariadb.service #啟動MariaDB [root@127 ~]# systemctl stop mariadb.service #停滯MariaDB [root@127 ~]# systemctl restart mariadb.service #重啟MariaDB [root@127 ~]# systemctl enable mariadb.service #設置開機主動啟動 [root@127 ~]# systemctl disenable mariadb.service #設置開機自啟封閉
初始化root暗碼
[root@127 ~]# mysql_secure_installation #為初始化賬戶root添加暗碼 NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none):這裡填寫root暗碼,假如是第一次初始化暗碼為空直接敲回車(回車前)
Enter current password for root (enter for none):這裡填寫root暗碼,假如是第一次初始化暗碼為空直接敲回車 (回車後↓) OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have a root password set, so you can safely answer 'n'. Change the root password? [Y/n] y New password: 這裡填寫新的暗碼 Re-enter new password: 這裡填寫反復的暗碼 Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y - Dropping test database... ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist ... Failed! Not critical, keep moving... - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!# 這裡表現修正暗碼勝利
數據庫登錄
[root@127 ~]# mysql -uroot -proot # mysql -u這裡是填寫的用戶名(默許為root) &我是空格& -p這裡填寫的是暗碼(默許為空)
這表現曾經進入MariaDBWelcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 23 Server version: 5.5.50-MariaDB MariaDB Server Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. # 經由過程/h可以檢查許多敕令 MariaDB [(none)]> 這裡是輸出sql語句的進口
以上是MariaDB的裝置
以上所述是小編給年夜家引見的Mysql的基本應用之MariaDB裝置辦法詳解,願望對年夜家有所贊助,假如年夜家有任何疑問請給我留言,小編會實時答復年夜家的。在此也異常感激年夜家對網站的支撐!