CentOS 7 系統安裝與遠端連線 MySQL 5.7
CentOS 7 版本將MySQL資料庫軟體從預設的程式列表中移除,那麼CentOS 7版本如何安裝MySQL呢,本文將指導大傢俱體的方法。
以滴滴雲DC2雲主機上的操作為例,首先切換賬戶許可權到root許可權,登入CentOS 7 系統的雲主機後輸入:
[dc2-user@didiyun dc2-user]# sudo su
切換成root許可權,然後執行下面的安裝方法:
官網安裝mysql-server方法:
[root@didiyun dc2-user]# yum install -y wget
[root@didiyun dc2-user]# wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
[root@didiyun dc2-user]# rpm -ivh mysql57-community-release-el7-8.noarch.rpm
[root@didiyun dc2-user]# yum install mysql-community-server -y
啟動MySQL
[root@didiyun dc2-user]# systemctl start mysqld
驗證是否啟動
[root@didiyun dc2-user]# systemctl status mysqld
MySQL安裝完成之後,在/var/log/mysqld.log檔案中給root生成了一個預設密碼。透過下面的方式找到root預設密碼,然後登入MySQL進行修改:
[root@didiyun dc2-user]# grep 'temporary password' /var/log/mysqld.log
2018-05-23T09:24:03.800263Z 1 [Note] A temporary password is generated for root@localhost: p?iT>b?iv7st
可以看到初始密碼為 p?iT>b?iv7st,登入資料庫:
[root@didiyun dc2-user]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.22Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
重新設定root密碼
mysql> set password for 'root'@'localhost'=password('Mypass12@');
為資料庫設定遠端連線
首先在防火牆規則中開啟3306埠
設定MySQL
mysql> grant all privileges on *.* to root@'%'identified by '123456';
如果是非root使用者(mysql的root使用者)遠端登入,則要先建立使用者
mysql>create user 'username'@'%' identified by 'password';
然後再進行連線
[root@didiyun dc2-user]#mysql -h <IP地址> -uusername -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.6.39 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31559758/viewspace-2219922/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- CentOS 7 - 安裝MySQL 5.7CentOSMySql
- CentOS 7 安裝 MySQL 5.7CentOSMySql
- CentOS7 安裝mysql5.7CentOSMySql
- mysql5.7安裝_centos7MySqlCentOS
- Centos7系統如何安裝MySQL5.7資料庫?CentOSMySql資料庫
- Mysql安裝和遠端登入--Centos7MySqlCentOS
- CentOS7下MySQL5.7安裝與配置(YUM)CentOSMySql
- centos7安裝圖形化介面並使用Windows遠端連線,安裝xrdpCentOSWindows
- CentOS7下yum安裝MySQL 5.7CentOSMySql
- CentOS7 yum安裝MySQL5.7CentOSMySql
- CentOS 7一鍵安裝桌面環境命令(可遠端RDP連線)CentOS
- CentOS 7 配置 VNC 遠端桌面連線CentOSVNC
- ubuntu系統安裝mysql並支援遠端連線的詳細過程UbuntuMySql
- VMware workstation16 中Centos7下MySQL8.0安裝過程+Navicat遠端連線CentOSMySql
- linux安裝mongoDB與遠端連線LinuxMongoDB
- Centos7下安裝Sql*Plus並連線遠端Oralce伺服器CentOSSQL伺服器
- centos7安裝mysql5.7 使用yumCentOSMySql
- CentOS7利用docker安裝MySQL5.7CentOSDockerMySql
- CentOS 7 原始碼編譯安裝 Mysql 5.7CentOS原始碼編譯MySql
- Centos7下安裝配置MySQL5.7CentOSMySql
- 在centos7上安裝mysql5.7CentOSMySql
- CentOS 7遠端連線相關問題CentOS
- centos7 安裝php7+mysql5.7+nginx+redisCentOSPHPMySqlNginxRedis
- CentOS安裝noVNC,以Web方式交付VNC遠端連線CentOSVNCWeb
- CentOS7 64位下MySQL5.7安裝與配置(YUM)CentOSMySql
- centos安裝mysql5.7CentOSMySql
- 騰訊雲安裝mysql遠端連線不上解決MySql
- PHP中PDO、mysql配置遠端連線、ecshop安裝PHPMySql
- docker安裝mysql8.0.20並遠端連線DockerMySql
- CentOS7 透過YUM安裝MySQL5.7CentOSMySql
- WindTerm的安裝及遠端連線Linux系統步驟Linux
- 遠端連線MYSQLMySql
- linux centos7 mysql無法遠端連線解決辦法LinuxCentOSMySql
- CentOS 6.5/6.6 安裝mysql 5.7CentOSMySql
- centos7系統msyqldump 客戶端安裝CentOS客戶端
- centos7安裝mysql5.7解壓縮版CentOSMySql
- CentOS7 64位安裝mysql5.7(linux)CentOSMySqlLinux
- Windows遠端連線CentOS桌面WindowsCentOS