MySQL5.7.13源碼編譯安裝指南(轉)

來源:互聯網
上載者:User

標籤:

系統 CenterOs 6.5

1.安裝依賴包(cmake make gcc等,其實好多都有了,不需要更新,為了防止世界被破壞,就裝下)

yum install gcc gcc-c++ -y
yum install -y ncurses-devel.x86_64
yum install -y cmake.x86_64
yum install -y libaio.x86_64
yum install -y bison.x86_64
yum install -y gcc-c++.x86_64

2.安裝boost庫1.59(聽高手們說,只能是這個版本,沒試過其他的,懶是樓主的本性,於是菜鳥們跟著命令走吧)

wget http://nchc.dl.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gztar zxvf  boost_1_59_0.tar.gz mv boost_1_59_0 /usr/local/boost

3.添加使用者組和使用者mysql(又是參考了各種大神的命令)

groupadd mysql          useradd -g mysql mysql     

4.下載安裝mysql5.7.13(下載時可能需要FQ?一直開著代理的樓主不知道是否需要FQ。。。接著就是需要root許可權,當然這是確定的)

wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.13.tar.gz

tar zxvf mysql-5.7.13.tar.gzcd mysql-5.7.13cmake -DCMAKE_INSTALL_PREFIX=/home/mysql -DMYSQL_DATADIR=/home/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_TCP_PORT=3306 -DMYSQL_USER=mysql -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boostmake && make install

5.初始化資料庫(就是資料庫的配置,呵呵,太給力的程式,大家要記住神一樣的密碼,樓主輸錯了無數次,終於成功)

/home/mysql/bin/mysqld --initialize --user=mysql --basedir=/home/mysql --datadir=/home/mysql/data
#返回資訊最後一行 2016-07-21T07:36:45.962094Z 1 [Note] A temporary password is generated for [email protected]: KQqCK:lmC15u #密碼要儲存

6.調整設定檔(各種複製黏貼)

mv /etc/my.cnf /etc/my.cnf.bakcp /home/mysql/support-files/my-default.cnf /etc/my.cnf

7.啟動mySQl執行個體

/home/mysql/bin/mysqld_safe

8.另外開一個控制台,登陸mysql,然後輸入那令人蛋疼的密碼

cd /home/mysql/bin./mysql  -uroot -p

9.修改密碼 alter user ‘root‘@‘localhost‘ identified by ‘123456‘;

123456789101112131415 #提示資訊#Enter password:#Welcome to the MySQL monitor.  Commands end with ; or \g.#Your MySQL connection id is 3#Server version: 5.7.13 #Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. #Oracle is a registered trademark of Oracle Corporation and/or its#affiliates. Other names may be trademarks of their respective#owners. #Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. mysql> alter user ‘root‘@‘localhost‘ identified by ‘123456‘;

10.至此, mysql 5.7.13編譯安裝成功.

MySQL5.7.13源碼編譯安裝指南(轉)

聯繫我們

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