Center os7 mysql

來源:互聯網
上載者:User

標籤:ng2   rpm   機器   user   啟動mysql   wget   roo   center   nbsp   

1 # yum -y install mysql-server mysql  mysql-dev

2 啟動mysql   # service mysqld start

3 為root使用者配置一個密碼 # mysqladmin -u root password ‘密碼‘

4 用root使用者登入  # mysql -u root -p  

5 輸入密碼登入到mysql  

6 看一下資料庫  mysql> show databases;

 

7 此時資料庫已經安裝完成了,但是此時只有本機能訪問,區域網路內其他使用者無法訪問到

8 切入mysql資料庫     mysql> use mysql;

9 查詢使用者表資訊        mysql> select host,user,password from user;

 

10 刪除無用的使用者        delete from user where password=‘‘;

11 重新查詢 此時只有一個使用者了  綁定機器名是localhost  也就是只有本機下可以訪問到

 

12 將localhost 修改為%   mysql> update user set host=‘%‘;

13 修改後需要重新整理許可權    mysql> flush privileges;

此時關閉防火牆後區域網路內其他使用者也可以訪問了

 

 

==========================================================

CentOS7下解決yum install mysql-server沒有可用包的問題

 

 

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

 

 

mysql-community-release-el7-5.noarch.rpm

 

ls -1 /etc/yum.repos.d/mysql-community*  

 

yum install mysql-server  

Center os7 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.