CentOS 6.4 安裝 Mysql方法 使用者遠程登入資料庫

來源:互聯網
上載者:User

標籤:

一:.在這裡我們都知道 系統的yum源Mysql版本一般都是5.1 5.2的比較多 但是有些程式 必須要5.5以上的版本才能支援

這時候我們應該怎麼辦呢  編譯安裝也太慢 太費時間  那麼我們就必要要藉助第三方yum來實現安裝Mysql5.5版本的預設使用centos yum安裝的mysql不是5.5版本的,我們需要增加兩個新的reporpm -Uvh http://mirror.steadfast.net/epel/6/i386/epel-release-6-8.noarch.rpmrpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm2.查看一下是不是有mysql 5.5了yum --enablerepo=remi,remi-test list mysql mysql-server3.安裝mysql5.5yum --enablerepo=remi,remi-test install mysql mysql-server4.啟動mysql5.5/etc/init.d/mysqld start5.設定開機啟動chkconfig --levels 345 mysqld on6.要啟用MySQL 安全設定請輸入以下命令/usr/bin/mysql_secure_installation7.不想啟動MySQL 安全設定命令,但至少也得修改一下root使用者密碼mysqladmin -u root password [your_password_here] 

 

  1. 二:
  2. 建立指定的資料庫 允許指定的IP登入
  3. DB_NAME = webdb
  4. USER_NAME = webdb_user
  5. REMOTE_IP = 10.0.15.25
  6. PASSWORD = password123
  7. PERMISSIONS = ALL
1. 建立資料庫 webdb

 

  1. mysql> CREATE DATABASE webdb;

2. 建立使用者webdb_user

  1. mysql> CREATE USER ‘webdb_user‘@‘10.0.15.25‘ IDENTIFIED BY ‘password123‘;

3.  授權

  1. mysql> GRANT ALL ON webdb.* TO [email protected]‘10.0.15.25‘;

4.  重載許可權表

  1. mysql> FLUSH PRIVILEGES;
 
  1. vi /etc/sysconfig/iptables

2. 在COMMIT之前加入以下內容:

  1. -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

3. 重啟Iptables:

  1. service iptables restart
  2. ## OR ##
  3. /etc/init.d/iptables restart

4. 在客戶機上測試遠端存取資料庫:

  1. mysql -h dbserver_name_or_ip_address -u webdb_user -p webdb

CentOS 6.4 安裝 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.