Centos7.1部署mysql-5.6.34(筆記)

來源:互聯網
上載者:User

標籤:資料庫   MySQL   

這裡安裝我用的的是mysql二進位包,主要減少編譯安裝的時間,當然快的還有yum的安裝方式。

mysql個版本:http://mirrors.sohu.com/mysql/

 

1、解決相關依賴問題,否則初始化資料庫會出現錯誤
yum install -y perl-Module-Install.noarch libaio*


2、解壓軟體包到/usr/local/src
tar xf mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz -C /usr/local/src/

 

3、設定mysql
cd /usr/local/src/mysql-5.6.34-linux-glibc2.5-x86ln -sv /usr/local/src/mysql-5.6.34-linux-glibc2.5-x86_64 /usr/local/mysqlcd /usr/local/mysql/
#建立使用者給予許可權
useradd  mysql  -s /sbin/nologinchown  -R mysql.mysql  ./* –R
#建立mysql的資料目錄
mkdir /data/mysql && chown  mysql.mysql /data/mysql –R
#初始化mysql
/usr/local/mysql/scripts/mysql_install_db  --user=mysql --datadir=/data/mysql --basedir=/usr/local/mysql/
#拷貝mysql的開機檔案以及設定檔
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqlcp /usr/local/mysql/my.cnf  /etc/my.cnf
#設定mysql的環境變數
ln -sv /usr/local/mysql/bin/mysql /usr/bin/
#最後啟動mysql即可
/etc/init.d/mysql restart
#訪問mysql
[[email protected] ~]# /usr/local/mysql/bin/mysqlWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 6Server version: 5.6.34 MySQL Community Server (GPL)Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

Centos7.1部署mysql-5.6.34(筆記)

聯繫我們

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