Linux CentOS6 mysql rpm安裝

來源:互聯網
上載者:User

標籤:blog   啟動mysql   conf   def   tps   password   初始化   style   move   

 mysql rpm檔案:https://dev.mysql.com/downloads/mysql/

選擇作業系統及版本:

點擊5.6版本連結

 

 

 

 將下載好的檔案上傳至伺服器

下面開始安裝:

檢查是是否有mysql的包

# rpm -qa | grep -i mysql

刪除原有包

# yum -y remove mysql-libs*

開始安裝下載好的三個檔案:

# rpm -ivh MySQL-server-5.6.38-1.el6.x86_64.rpm
# rpm -ivh MySQL-devel-5.6.38-1.el6.x86_64.rpm
# rpm -ivh MySQL-client-5.6.38-1.el6.x86_64.rpm 

將mysql的設定檔copy到/etc目錄下
# cp /usr/share/mysql/my-default.cnf /etc/my.cnf
初始化MySQL

# /usr/bin/mysql_install_db
啟動MySQL
# service mysql start
查看root帳號的初始密碼
# cat /root/.mysql_secret

紅框裡面是隨機密碼 用這個密碼登入mysql

# mysql -u root _TwfGT3fZcjKWOT3

修改mysql密碼

# set password=password(‘123456‘);

退出mysql命令列

設定開機啟動

# chkconfig mysql on

# chkconfig --list | grep mysql

 

至此mysql安裝完成!!

 

 

 

 




Linux CentOS6 mysql rpm安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.