Red Hat 7.2 RPM安裝Mysql 5.7.12

來源:互聯網
上載者:User

標籤:知識庫   sys   string   cat   use   oca   red   lib   base   

安裝Red Hat  7.2  開發包Java包全部安裝

下載Mysql  5.7.12

wget  http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.12-1.el7.x86_64.rpm-bundle.tar

查看是否安裝了MySQL

rpm -qa | grep mysql 

卸載mysql
rpm -e –nodeps 

解壓mysql 
tar -xvf mysql-5.7.12-1.el7.x86_64.rpm-bundle.tar

安裝mysql 
yum install mysql-community-{client,common,libs}-*  

rpm -ivh mysql-community-server-5.7.12-1.el7.x86_64.rpm 

啟動Mysql服務

先用常規的啟動方法 service mysqld start

z在使用最新啟動方法 systemctl start mysqld.service

 

查看MySQL伺服器的狀態

sudo service mysqld status

 

產生隨機密碼
grep ‘temporary password‘ /var/log/mysqld.log
2016-04-30T11:25:13.632616Z 1 [Note] A temporary password is generated for [email protected]: X9.L=p4iylZD


配置隨機密碼
mysql -uroot -p
X9.L=p4iylZD

ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘HanZheng.123‘;

 

5.7中儲存密碼的欄位不再是password了,變成了authentication_string

update mysql.user set authentication_string=password(‘root‘) where user=‘root‘‘;

修改root密碼後如果第一次使用root使用者登入mysql系統還會需要重設一次root密碼

SET PASSWORD=PASSWORD(‘root‘);



重新登陸
mysql -uroot -p
HanZheng.123

Red Hat 7.2 RPM安裝Mysql 5.7.12

聯繫我們

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