CentOS7安裝調(diào)試Mysql數(shù)據(jù)庫的步驟詳解【實(shí)例】
本實(shí)例要求下載并安裝調(diào)試Mysql數(shù)據(jù)庫。
第一步:下載Mysql數(shù)據(jù)庫安裝所需的全部軟件。
我已提前下載好數(shù)據(jù)庫軟件,直接在服務(wù)器下載即可,如下:
通過scp直接下載:
[root@agt20 ~]# scp root@192.168.122.10:/root/mysql* /root/
軟件如下圖:
[root@agt20 ~]# ls mysql-* mysql-5.7.17.tar mysql-community-client-5.7.17-1.el7.x86_64.rpm mysql-community-common-5.7.17-1.el7.x86_64.rpm mysql-community-devel-5.7.17-1.el7.x86_64.rpm mysql-community-embedded-5.7.17-1.el7.x86_64.rpm mysql-community-embedded-compat-5.7.17-1.el7.x86_64.rpm mysql-community-embedded-devel-5.7.17-1.el7.x86_64.rpm mysql-community-libs-5.7.17-1.el7.x86_64.rpm mysql-community-libs-compat-5.7.17-1.el7.x86_64.rpm mysql-community-minimal-debuginfo-5.7.17-1.el7.x86_64.rpm mysql-community-server-5.7.17-1.el7.x86_64.rpm mysql-community-test-5.7.17-1.el7.x86_64.rpm
第二步:通過yum進(jìn)行安裝,起服務(wù)器并查看
[root@agt20 ~]# yum -y install mysql-*.rpm [root@agt20 ~]# systemctl restart mysqld [root@agt20 ~]# systemctl enable mysqld [root@agt20 ~]# systemctl status mysqld.service \u25cf mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since \u4e8c 2019-10-15 11:29:11 CST; 1min 15s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Main PID: 31584 (mysqld) CGroup: /system.slice/mysqld.service \u2514\u250031584 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid... 10\u6708 15 11:28:42 agt20.tedu.cn systemd[1]: Starting MySQL Server... 10\u6708 15 11:29:11 agt20.tedu.cn systemd[1]: Started MySQL Server. [root@agt20 ~]#
第三步:連接MySQL服務(wù)器,修改密碼;
1)查看初始密碼
[root@agt20 ~]# grep -i 'password' /var/log/mysqld.log 2019-10-15T03:28:55.200931Z 1 [Note] A temporary password is generated for root@localhost: r3qhDysMrM)
2)使用初始密碼連接mysql服務(wù)
[root@agt20 ~]# mysql -uroot -p'r3qhDysMrM)' mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.17 Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
3)重置數(shù)據(jù)庫管理員roo本機(jī)登錄密碼
mysql> alter user root@localhost identified by 'Pwd@123...'; Query OK, 0 rows affected (0.00 sec)
4)修改密碼策略
mysql> set global validate_password_policy=0; Query OK, 0 rows affected (0.01 sec) mysql> set global validate_password_length=6; Query OK, 0 rows affected (0.00 sec) mysql> alter user root@localhost identified by 'pwd@123'; Query OK, 0 rows affected (0.00 sec)
5)使用修改后的密碼登錄
[root@agt20 ~]# mysql -uroot -ppwd@123 mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.7.17 MySQL Community Server (GPL) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
至此Mysql數(shù)據(jù)庫安裝調(diào)試完成?。。?!
總結(jié)
以上所述是小編給大家介紹的CentOS7安裝調(diào)試Mysql數(shù)據(jù)庫的步驟詳解,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
如果你覺得本文對(duì)你有幫助,歡迎轉(zhuǎn)載,煩請(qǐng)注明出處,謝謝!
相關(guān)文章
判斷Unix系統(tǒng)及庫文件是32位還是64位的詳解
這篇文章主要介紹了判斷Unix系統(tǒng)及庫文件是32位還是64位的的相關(guān)資料,這里整理下查看系統(tǒng)位數(shù)的命令,需要的朋友可以參考下2016-11-11關(guān)于Windows 不能在 本地計(jì)算器 啟動(dòng) Apache2(phpstudy)
今天在自己的本子上準(zhǔn)備放多個(gè)虛擬站點(diǎn)。用的是#phpstudy#。在軟件自身的站點(diǎn)設(shè)置中,根據(jù)提示添加的多站點(diǎn)無效不知道是否和我的系統(tǒng)是Win7有關(guān)2012-09-09Vim如何使用相對(duì)行號(hào)實(shí)現(xiàn)一切操作詳解
在使用用Vim時(shí)時(shí)常會(huì)遇到像復(fù)制多行或者想快速向下/向上移動(dòng)多行時(shí)而不知道行數(shù)的情況, 今天發(fā)現(xiàn)一個(gè)Vim對(duì)此有幫助的特性: 相對(duì)行號(hào),下面這篇文章主要給大家介紹了關(guān)于Vim如何使用相對(duì)行號(hào)實(shí)現(xiàn)一切操作的相關(guān)資料,需要的朋友可以參考下。2017-11-11Linux 系統(tǒng)雙網(wǎng)卡綁定配置實(shí)現(xiàn)
這篇文章主要介紹了Linux 系統(tǒng)雙網(wǎng)卡綁定配置實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-06-06設(shè)置ssh無密碼登錄linux服務(wù)器的方法
這篇文章主要介紹了設(shè)置ssh無密碼登錄linux服務(wù)器,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-08-08vim學(xué)習(xí)高級(jí)技巧之序列的生成方法詳解
Vim經(jīng)過了這么多年的發(fā)展,已經(jīng)是世界上最強(qiáng)悍的編輯器之一,這篇文章主要給大家介紹了關(guān)于vim高級(jí)學(xué)習(xí)技巧之序列生成的相關(guān)資料,文中通過示例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)下吧。2017-09-09vscode連接遠(yuǎn)程Linux服務(wù)器及免密登陸的詳細(xì)步驟
這篇文章主要介紹了vscode連接遠(yuǎn)程Linux服務(wù)器及免密登陸,本文分步驟給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2022-08-08