centos 安裝 mysql

來源:互聯網
上載者:User

標籤:

環境與資源

    PC系統: Centos 6.5 32位

    MySQL Server 5.6 

    URL: http://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-server-5.6.27-1.el6.i686.rpm

    MySQL Client 5.6

    URL:http://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-client-5.6.27-1.el6.i686.rpm

查看是否已裝有mysql

#rpm -qa | grep mysql

如果有,則強制移除

#rpm -e --nodeps mysql-libs-5.1.73-5.el6_6.i686

安裝Mysql

1) 下載MySQL Server和MySQL Client

#wget http://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-server-5.6.27-1.el6.i686.rpm

#wget  http://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-client-5.6.27-1.el6.i686.rpm 

2) 解壓

#rpm -ivh MySQL-server-5.6.27-1.e16.i686.rpm

#rpm -ivh MySQL-client-5.6.27-1.e16.i686.rpm

注意:如果出現如下錯誤

解決方案:

#yum install libaio.so.1 libnuma.so.1


使用mysql

1) 安裝完預設設定檔在/usr/share/mysql/my-default.cnf, 因此將my-default.cnf拷貝到/etc/my.cnf中

#cp /usr/share/mysql/my-default.cnf /etc/my.cnf

2) 啟動mysql

#/etc/init.d/mysql start

3)mysql用戶端串連

#mysql -uroot

解決方案:(修改root使用者密碼)

/etc/init.d/mysql stop   (service mysqld stop )
/usr/bin/mysqld_safe --skip-grant-tables
另外開個SSH串連
[[email protected] ~]# mysql
mysql>use mysql
mysql>update user set password=password("") where user="root";
mysql>flush privileges;
mysql>exit

4) 再使用mysql 用戶端串連

#/etc/init.d/mysql start (啟動mysql 服務)

#mysql -uroot


centos 安裝 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.