CentOS下配置MySQL允許root使用者遠程登入

來源:互聯網
上載者:User

標籤:登入   sel   額外   資料   mys   記錄   檔案   支援   roo   

1.常用命令:

安裝上傳下載檔案命令
yum install lrzsz
安裝webget工具
yum -y install wget

------------------------------------分割線---------------------------------------------

在CentOS上成功安裝MySQL Server後,發現無法用用戶端進行串連,查閱相關質料後發現如果想讓root使用者支援遠程登入,是需要進行額外配置的;配置步驟如下:

步驟:    修改root密碼 (可選)
# 切換到mysql這個資料庫mysql> use mysql;# 將root使用者的密碼修改為:123456mysql> update user set password=PASSWORD(‘123456‘) where user=‘root‘;

  

 檢查root配置

# root使用者登入$ mysql -u root -p# 切換到mysql這個資料庫mysql> use mysql;# 查看root使用者配置mysql> select host,user from user where user=‘root‘;

  修改root配置 

如果查詢結果中不包含以下記錄,請添加,否則請忽略次步驟hostuser%rootmysql> update user set host = ‘%’ where user = ‘root’ and host=’127.0.0.1’;

  給使用者授權

mysql> grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘ with grant option;

  使配置生效

mysql> flush privileges;

  

 

CentOS下配置MySQL允許root使用者遠程登入

聯繫我們

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