MYSQL資料庫安裝記

來源:互聯網
上載者:User

標籤:nbsp   rman   new   code   password   option   community   l資料庫   cmd   

這回安裝資料庫裝,做下記錄。

1、下載mysql源安裝包

shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

2、安裝mysql源

shell> yum localinstall mysql57-community-release-el7-8.noarch.rpm

3、檢查mysql源是否安裝成功

shell> yum repolist enabled | grep "mysql.*-community.*"

4、安裝MYSQL

shell> yum install mysql-community-server

5、啟動MYSQL服務

shell> systemctl start mysqld

6、設定開機啟動

shell> systemctl enable mysqldshell> systemctl daemon-reload

7、查看MYSQL臨時密碼

shell> grep ‘temporary password‘ /var/log/mysqld.log

8、修改MYSQL預設密碼

shell> mysql -uroot -pmysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘MyNewPass4!‘; 或mysql> set password for ‘root‘@‘localhost‘=password(‘MyNewPass4!‘); 

9、添加遠程登陸使用者

mysql> GRANT ALL PRIVILEGES ON *.* TO ‘yangxin‘@‘%‘ IDENTIFIED BY ‘Yangxin0917!‘ WITH GRANT OPTION;

10、配置預設編碼為UTF-8

[mysqld]character_set_server=utf8init_connect=‘SET NAMES utf8‘

11、開啟防火牆

firewall-cmd --add-port=3306/tcp --permanent

之前MYSQL配置好了,但是無法遠程登陸,發現系統中沒有IPtable。其實CentOS7 中是firewall,需要上面的命令才能開啟MYSQL 3306連接埠。

 

MYSQL資料庫安裝記

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.