[Linux]Centos7下mysql小白安裝教程

來源:互聯網
上載者:User

標籤:

一、工具下載

  mysql下載傳送門

    SecureCRTSecureFX下載傳送門

二、上傳安裝檔案

 

三、查看上傳的mysql安裝檔案

[[email protected] ~]# lsanaconda-ks.cfg  MySQL-client-advanced-5.6.22-1.el7.x86_64.rpm  MySQL-server-advanced-5.6.22-1.el7.x86_64.rpm  公用  模板  視頻  圖片  文檔  下載  音樂  案頭

 

四、安裝perl

[[email protected] ~]yum install -y perl-Module-Install.noarch


五、安裝libaio

[[email protected] ~]yum install -y libaio libaio-devel


六、修改SELINUX的cfg

[[email protected] ~]vi /etc/selinux/config

    修改(按i鍵後可修改)SELINUX=enforcing為SELINUX=disabled,存檔退出(按Esc鍵後輸入:wq後斷行符號)

 

七、重啟系統

[[email protected] ~]reboot

八、安裝server

[[email protected] ~]rpm -ivh MySQL-server-advanced-5.6.22-1.el7.x86_64.rpm

九、安裝client

[[email protected] ~]rpm -ivh MySQL-client-advanced-5.6.22-1.el7.x86_64.rpm

十、啟動mysql

[[email protected] ~]# service mysql startStarting MySQL SUCCESS! 

十一、設定root密碼

[[email protected] ~]# service mysql stop [[email protected] ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking & [[email protected] ~]# mysql -u root mysql mysql> UPDATE user SET Password=PASSWORD(‘123‘) where USER=‘root‘; mysql> FLUSH PRIVILEGES; mysql> quit [[email protected] ~]# service mysql start[[email protected] ~]# mysql -u root -p Enter password: 123

十二、啟動mysql時報錯

 ERROR! MySQL server PID file could not be found!     

 kill掉所有出來的進程再啟動mysql

[[email protected] ~]# ps aux |grep mysq*
root      19162  0.0  0.0 113252  1600 pts/1    S    09:24   0:00 /bin/sh /usr/bin/mysqld_safe --user=mysql --skip-grant-tables --skip-networking
mysql     19280  0.1  5.7 1038812 456172 pts/1  Sl   09:24   0:03 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --skip-grant-tables --skip-networking --log-error=/var/lib/mysql/localhost.err --pid-file=/var/lib/mysql/localhost.pid
root      19678  0.0  0.0 112656   980 pts/1    S+   09:55   0:00 grep --color=auto mysq*
[[email protected] ~]# kill 19162
[[email protected] ~]# kill 19280
[[email protected] ~]# kill 19678

 

[Linux]Centos7下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.