mysql5安裝教程
產品型號: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、(1)用鼠標右點桌面,選“屬性”,打開“顯示屬性”對話框。(2)點“設置”標籤,點“高級”按鈕,打開新對話框。2、(1)打開“設備管理器”窗口。(我的電腦-屬性-硬件-設備管理器)(2)展開“顯示卡”節點,其中項目的名稱即為顯卡型號。3、(1)點“開始”按鈕,在開始菜單中點“運行”,打開...
-
樓上樓下安裝兩個路由器方法,如何樓上樓下安裝兩個路由器
1、兩個無線路由器,主路由器A,副路由器B,主路由器A中不需要任何更改。把副路由器B放在家合適的位置中,接通電源。打開手機連接上副路由器B的WIFI(也可用電腦設置),打開任一瀏覽器,在地址欄中輸入路由器的IP(不同路由器的IP不一樣,具體查看説明書或路由器背面標籤)。2、輸...
-
天璣1100相當驍龍多少
產品型號:華為p50系統版本:EMUI11天璣1100相當於驍龍865處理器,具體介紹如下:1、製程工藝:天璣1100採用了6nm的工藝製程可以減少用户的能耗。驍龍865採用7nm製作工藝,是目前最為成熟的芯片製作工藝,可以為用户帶來更優享受。2、CPU方面:在架構方面,得益於新的工藝,天璣11...
-
蘋果手機怎麼縮圖
智能手機的拍照功能越來越好,拍出來的圖片也越來越清晰,用手機來記錄生活中的點滴已成為了人們的日常習慣,而平時也會用手機對圖片進行一些簡單的處理,那麼,蘋果手機要怎麼縮小圖片尺寸呢?蘋果手機圖片尺寸可以通過郵件來進行調整。打開蘋果手機,在相冊中選擇需要調整...