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、長截圖辦法一iOS13上新之後自帶的長截圖方法,是在我們瀏覽網頁的時候使用的。操作方法:上音量鍵+開關鍵一起按下,然後點開截好的圖片,選擇“整頁”截圖即可。2、長截圖方法二利用QQ實現長截圖。操作方法:首先就是需要我們打開QQ,然後試着上音量鍵+開關鍵一起按下...
-
怎樣知道別人是否退出微信運動
1、在微信裏點擊【我】,再點擊【設置】。2、進入設置界面後,點擊【通用】選項。3、接下來,找到並點擊【輔助功能】。4、在輔助功能中,找到並打開【微信運動】。5、然後,點擊【進入微信運動】選項。6、點擊微信運動底部的【步數排行榜】。7、在排行榜查找好友,如果對...
-
微信上的表情包怎麼保存到手機,微信上的表情包如何保存到手機
1、在聊天記錄中找到要保存的微信表情,長按該表情彈出菜單,然後選擇編輯。2、在編輯界面中,可以根據自己的需求對錶情圖片進行修改,然後點擊完成。3、在下方彈出的菜單中,點擊保存圖片。4、手機提示我們保存成功了,也就是說該微信表情已經保存到手機裏了。...
-
關於神舟飛船的資料
1、神舟號飛船的概念:神舟飛船是中國自行研製,具有完全自主知識產權,達到或優於國際第三代載人飛船技術的飛船,神舟號飛船是採用三艙一段,即由返回艙,軌道艙,推進艙和附加段構成,由13個分系統組成。神舟號飛船與國外第三代飛船相比,具有起點高,具備留軌利用能力等特點,神...