mysql安裝配置教程
產品型號:Thinkpad E15
系統版本:centos7
軟體版本:mysql 5.7
mysql安裝教程
1.使用yum安裝mysql資料庫的軟體包
[root@xuegod63 ~]# yum -y install mariadb-server mariadb
注:
mariadb-server #MariaDB資料庫
mariadb # MariaDB伺服器Linux下客戶端
注:從centos7系統開始,系統中自帶的mysql資料庫變成了mariadb-server,mariadb-server和mysql操作上一樣。mariadb-server是mysql的一個分支。
2.啟動資料庫服務
[root@xuegod63 ~]# systemctl start mariadb #啟動MariaDB服務
[root@xuegod63 ~]# systemctl enable mariadb #設定開啟自動啟動MariaDB服務
3. 安裝完mariadb-server後,執行mysql_secure_installation去除安全隱患
[root@xuegod63 ~]# mysql_secure_installation#進入安全配置導向
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, 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使用者沒有密碼
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] Y#是否設定root使用者密碼,輸入Y
New password: 123456 #新密碼123456
Re-enter new password: 123456
Password updated successfully!
。。。
Remove anonymous users? [Y/n] Y #是否刪除匿名使用者,生產環境建議刪除,所以直接回車或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 #是否禁止root遠端登入,根據自己的需求選擇Y/n並回車,建議禁止
... 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 #是否刪除test資料庫,直接回車或Y
- Dropping test database...
... Success!
- 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!
… Success!
至此資料庫安裝成功。
4. 登入資料庫
[root@xuegod63 ~]# mysql -u root -p123456
MariaDB [(none)]> show databases; #沒有test資料庫 #執行時,所有命令以;號結尾
+-------------------------+
| Database|
+-------------------------+
| information_schema|
| mysql|
| ucenter |
+-------------------------+
3 rows in set (0.00 sec)
MariaDB [(none)]> exit #退出命令可以加分號,也可以不加分號。
總結:
1、使用yum安裝mysql資料庫的軟體包
2、啟動資料庫服務
3、執行mysql_secure_installation去除安全隱患
4、登入資料庫
-
怎麼檢視微博最近訪客,如何檢視微博最近訪客
怎麼檢視微博最近訪客:1、首先網頁登入微博首頁。2、然後點選右上角自己的頭像。3、點選進去後點選管理中心。4、在管理中心裡可以看到全部資料的概覽。5、往下拉可以看到具體的詳情資訊。6、訪客互動可以在互動分析裡進行檢視,也可以進行匯出。...
-
微信個性簽名的使用方法
1、點選開啟微信,然後點選右下角的“我”圖示,進入個人中心。2、然後直接點選自己的頭像,進入“個人資訊”。3、現在就可以看到在個人資訊的最後一行就可以看到“個性簽名”選單,現在還沒有設定個性簽名,點選開啟進行設定。4、輸入你的個性簽名,注意這裡不能太長,有字...
-
怎麼檢視微信群在哪裡
1、成功登陸微信後,點選微信通訊錄選項卡,在微信通訊錄裡可以看到群聊,點選群聊。2、開啟群聊後,在群聊這裡什麼都沒有,點選群聊右上角的“+”圖示。3、在發起群聊介面上,點選選擇一個群。4、點選進入到選擇群聊介面後,在選擇群聊就裡可以看到所有的微信群了。5、點選...
-
蘋果6s沒有插耳機卻顯示耳機模式怎麼辦
蘋果6s顯示耳機模式,有兩大原因,一是手機硬體出了故障,硬體則是耳機插座進灰或進水等造成的接觸不良;二是蘋果手機系統設定方面要進行更改,系統在某些情況下有可能識別耳機模式出錯。如果是蘋果6s硬體出了問題,那可能是耳機插孔金屬片走位,用筆芯撥一下耳機插孔,將裡面...