centos安裝mysql57

來源:互聯網
上載者:User

標籤:檔案   使用者   sudo   pos   man   centos安裝   name   upd   本地   

下載源安裝檔案

wget http://repo.mysql.com//mysql57-community-release-el7-8.noarch.rpm

wget https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm


本地安裝rpm包(配置MySQL安裝源)

yum -y localinstall mysql57-community-release-el7-11.noarch.rpm


查看所有MySQL安裝源(預設MySQL安裝版本5.7)

yum repolist all | grep mysql


關閉MySQL 5.6安裝源

sudo yum-config-manager --disable mysql56-community


開啟MySQL 5.7安裝源

sudo yum-config-manager --enable mysql57-community
沒有yum-config-manager命令可以安裝yum install yum-utils.noarch工具 或者編輯/etc/yum.repos.d/mysql-community.repo檔案enable項為1表示開啟,為0表示關閉

VI命令修改python版本為2.7

vi /usr/libexec/urlgrabber-ext-down

yum -y install yum-utils

vi /bin/yum-config-manager

 

安裝MySQL

yum -y install mysql-devel mysql-community-server


啟動MySQL

systemctl start mysqld.service


安全配置MySQL

mysql_secure_installation

 

設定密碼

use mysql;

update user set password=password(‘密碼‘) where user=‘root‘;

flush privileges;

配置

 

mysql設定檔為/etc/my.cnf

 

最後加上編碼配置

 

[mysql]default-character-set =utf8

 

這裡的字元編碼必須和/usr/share/mysql/charsets/Index.xml中一致。

 

 

2、遠端連線設定

 

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

 

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

 

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

 

mysql>create user ‘username‘@‘%‘ identified by ‘password‘;  

 

重啟MYSQL

1、可以將mysqld放到/etc/init.d
用/etc/init.d/mysqld restart命令重啟
(cp mysql-5.5.31/support-files/mysql.server /etc/init.d/mysqld)


2、或者用systemctl
systemctl restart mysql
或者
systemctl restart mariadb


3、service mysql restart
service mariadb restart

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

 

centos安裝mysql57

相關文章

聯繫我們

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