RHEL6.4 安裝 MySQL 5.6.27

來源:互聯網
上載者:User

RHEL6.4 安裝 MySQL 5.6.27

RHEL6.4 安裝 MySQL 5.6.27

下載(臨時地址, 如不可用,請到Oracle官網下載)

採用rpm安裝. mysql服務端要安裝:

ftp://pepstack.com/pub/rpm/MySQL-server-5.6.27-1.el6.x86_64.rpm

mysql用戶端要安裝:

ftp://pepstack.com/pub/rpm/MySQL-client-5.6.27-1.el6.x86_64.rpm

ftp://pepstack.com/pub/rpm/MySQL-devel-5.6.27-1.el6.x86_64.rpm

服務端安裝過程:

刪除舊的:

# rpm -qa | grep -i mysql

mysql-libs-5.1.66-2.el6_3.x86_64

# rpm -ev --nodeps mysql-libs-5.1.66-2.el6_3.x86_64

謹慎: 可能需要刪除舊的檔案(如果有):

# rm -f /etc/my.cnf

# rm -rf /usr/var/lib/mysql

安裝新版本:

# rpm -ivh ./MySQL-server-5.6.27-1.el6.x86_64.rpm

用戶端安裝過程:

# rpm -ivh ./MySQL-client-5.6.27-1.el6.x86_64.rpm

# rpm -ivh ./MySQL-devel-5.6.27-1.el6.x86_64.rpm

服務端啟動和登入:

# service mysql start

# mysql -u root

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

解決此錯誤:

1 停止mysql服務:

# service mysql stop

2 啟動mysql服務,跳過驗證:

# mysqld_safe --skip-grant-tables&

3 登入mysql:

# mysql --user=root mysql

4 設定root使用者密碼:

mysql > update user set Password=PASSWORD('abcd1234');

mysql > flush privileges;

mysql > exit;

5 現在可以殺死mysqld_safe進程:

# killall mysqld_safe&

6 重啟mysql服務:

# service mysql start

查看連接埠:

# netstat -nat | grep 3306

用戶端登入(ipaddr為mysql服務所在的伺服器ip地址):

# mysql -u root -h ipaddr -pabcd1234

相關文章

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.