centos6.5二進位安裝mysql

來源:互聯網
上載者:User

標籤:二進位   mysql   

[[email protected] ~]# yum install libaio-devel -y    #安裝共用庫

[[email protected] ~]# wget http://mirrors.sohu.com/mysql/My ... ux2.6-x86_64.tar.gz #下載MySQL二進位包

[[email protected] ~]# tar xf mysql-5.5.48-linux2.6-x86_64.tar.gz #解壓二進位包

[[email protected] ~]# mv mysql-5.5.48-linux2.6-x86_64 /usr/local/mysql #將二進位包移動到安裝目錄

[[email protected] ~]# useradd mysql -s /sbin/nologin -M #建立MySQL使用者  

[[email protected] ~]# chown -R mysql.mysql /usr/local/mysql/data/ #授權MySQL使用者屬主


初始化MySQL
[[email protected] ~]# cd /usr/local/mysql
[[email protected] mysql]# ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/

[[email protected] mysql]# \cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf #拷貝MySQL設定檔
[[email protected] mysql]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld #拷貝MySQL開機檔案  
[[email protected] mysql]# /etc/init.d/mysqld start #啟動MySQL
[[email protected] mysql]# chkconfig mysqld on #設定開機啟動

[[email protected] mysql]# vi /etc/profile.d/mysql.sh #設定mysql環境變數。添加如下內容

export PATH=$PATH:/usr/local/mysql/bin

[[email protected] mysql]# source /etc/profile.d/mysql.sh #執行命令使用其生效

[[email protected] mysql]# /usr/lcoal/mysql/bin/mysql_secure_installation #資訊安全設定精靈


[[email protected] mysql]# netstat -lntup|grep mysql
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      1545/mysqld         
[[email protected] mysql]# mysql -uroot -p #登入MySQL


點擊下面的複製代碼,粘貼至命令列執行即可。

  1. yum install libaio-devel wget -y

  2. wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.48-linux2.6-x86_64.tar.gz 

  3. tar xf mysql-5.5.48-linux2.6-x86_64.tar.gz

  4. mv mysql-5.5.48-linux2.6-x86_64 /usr/local/mysql

  5. useradd mysql -s /sbin/nologin -M

  6. chown -R mysql.mysql /usr/local/mysql/data/

  7. cd /usr/local/mysql

  8. ./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data/

  9. \cp /usr/local/mysql/support-files/my-small.cnf /etc/my.cnf

  10. cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

  11. cp -a /usr/local/mysql/bin/* /usr/local/sbin/

  12. chmod +x /etc/init.d/mysqld

  13. /etc/init.d/mysqld start

  14. chkconfig mysqld on

  15. mysqladmin -uroot password "AbC123456"

  16. mysql -uroot -p"AbC123456"


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.