centos6.5上安裝mysql過程

來源:互聯網
上載者:User

標籤:

1.查看已安裝的版本

rpm -qa|grep -i mysql

 

2.刪除已有mysql

yum remove mysql-libs  移除已經安裝的mysql

 

命令:rm -fr /usr/lib/mysql   rm -fr /usr/include/mysql  刪除老版本mysql的開發標頭檔和庫

rm -fr /var/lib/mysql   刪除資料檔案

rm -f /etc/my.cnf   刪除設定檔

 

3.開始mysql

使用rz命令上傳兩個安裝包

MySQL-client-5.6.17-1.linux_glibc2.5.x86_64.rpm

MySQL-server-5.6.17-1.linux_glibc2.5.x86_64.rpm

安裝兩個包

rpm -ivh MySQL-client-5.6.17-1.linux_glibc2.5.x86_64.rpm

rpm -ivh MySQL-server-5.6.17-1.linux_glibc2.5.x86_64.rpm

設定檔在/usr/my.cnf

使用/etc/init.d/mysql start 啟動  或service mysql start啟動

不能使用mysqladmin -u root password 123456改root密碼   回報‘Access denied for user ‘root‘@‘localhost‘ (using password: NO)‘錯誤

而要這樣

service mysql stop  停止服務

mysqld_safe --user=mysql --skip-grant-tables --skip-networking &   跳過許可權

mysql -u root mysql   進去改密碼

UPDATE user SET Password=PASSWORD(‘newpassword‘) where USER=‘root‘ and host=‘root‘ or host=‘localhost‘;

FLUSH PRIVILEGES;  重新整理

mysql -uroot -p  用設定的密碼就能夠進去了

centos6.5上安裝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.