CentOS 7 安裝MySql Server 5.6

來源:互聯網
上載者:User

標籤:

1. 安裝MySql Server

在/etc/yum.repos.d/目錄下添加以下檔案mysql-community.repo檔案,內容如下:

1 [mysql56-community]2 name=MySQL 5.6 Community Server3 baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/4 enabled=15 gpgcheck=0

     執行yum install mysql-community-server即可。

     啟動服務 # service mysqld start

2 .設定密碼
 1 [[email protected] yl]# mysql -u root  2 Welcome to the MySQL monitor.  Commands end with ; or \g. 3 Your MySQL connection id is 3 4 Server version: 5.6.26 MySQL Community Server (GPL) 5  6 Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. 7  8 Oracle is a registered trademark of Oracle Corporation and/or its 9 affiliates. Other names may be trademarks of their respective10 owners.11 12 Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.13 14 mysql> set password for ‘root‘@‘localhost‘ =password(‘password‘);
3. 遠端連線設定

把在所有資料庫的所有表的所有許可權賦值給位於所有IP地址的root使用者。

mysql> grant all privileges on *.* to [email protected]‘%‘identified by ‘password‘;

如果是新使用者而不是root,則要先建立使用者

mysql>create user ‘username‘@‘%‘ identified by ‘password‘;  
4  . 將firewall關閉:
[[email protected] ~]# systemctl stop firewalld.service #停止firewall
[[email protected] ~]# systemctl disable firewalld.service #禁止firewall開機啟動
最後reboot電腦 

此時就可以進行遠端連線了。

CentOS 7 安裝MySql Server 5.6

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.