5.7編譯cmake要求版本最低為2.8,目前為2.6,是以需要更新cmake版本。資訊如下
<code>shell> cmake . -DCMAKE_INSTALL_PREFIX=/db/mysql/mysql_57 -DMYSQL_DATADIR=/db/mysql/mysql_57/data</code>
<code>CMake Error at CMakeLists.txt:21 (CMAKE_MINIMUM_REQUIRED):</code>
<code> </code><code>CMake 2.8.2 or higher is required. You are running version 2.6.4</code>
<code>-- Configuring incomplete, errors occurred!</code>
<code>shell> cmake --version</code>
<code>cmake version 2.6-patch 4</code>
<code>shell> tar zxvf cmake-3.2.2.tar.gz</code>
<code>shell> cd cmake-3.2.2/</code>
<code>shell> ./bootstrap</code>
<code>shell> make && make install</code>
<code>cmake version 3.2.2</code>
5.7編譯需要boost類庫,可使用 -DDOWNLOAD_BOOST=1 -DWITH_BOOST= 參數将在指定路徑查找,如未找到會指
定下載下傳并解壓到指定的路徑
<code>問題描述</code>
<code>shell> cmake . -DCMAKE_INSTALL_PREFIX=/db/mysql/mysql_57 -DMYSQL_DATADIR=/db/mysql/mysql_57/data </code>
<code>CMake suite maintained and supported by Kitware (kitware.com/cmake).</code>
<code>-- Could not find (the correct version of) boost.</code>
<code>-- MySQL currently requires boost_1_57_0</code>
<code>CMake Error at cmake/boost.cmake:76 (MESSAGE):</code>
<code> </code><code>You can download it </code><code>with</code> <code>-DDOWNLOAD_BOOST=1 -DWITH_BOOST=安裝boost庫</code>
<code>shell> tar jxvf boost_1_57_0.tar.bz2</code>
<code>shell> cd boost_1_57_0/</code>
<code>shell> ./bootstrap.sh</code>
<code>shell> ./b2 install</code>
<code>安裝後目錄</code>
<code>shell> ls /usr/local/include/</code>
<code>boost</code>
之前版本mysql_install_db是在mysql_basedir/script下,5.7放在了mysql_install_db/bin目錄下,且已被廢棄。
<code>shell> cd /db/mysql/mysql_57</code>
<code>shell> bin/mysql_install_db --basedir=. --datadir=data --user=mysql</code>
<code>[WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize</code>
<code>shell> bin/mysqld --initialize</code>
<code>2015-04-21T18:17:53.169216Z 0 [Warning] TIMESTAMP </code><code>with</code> <code>implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation </code><code>for</code> <code>more details).</code>
<code>2015-04-21T18:17:58.702510Z 0 [Warning] InnoDB: New log files created, LSN=45790</code>
<code>2015-04-21T18:17:59.538811Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.</code>
<code>2015-04-21T18:17:59.646010Z 0 [Warning] Failed to setup SSL</code>
<code>2015-04-21T18:17:59.646105Z 0 [Warning] SSL error: SSL context is not usable without certificate and private key</code>
<code>2015-04-21T18:17:59.663795Z 1 [Warning] A temporary password is generated </code><code>for</code> <code>root@localhost: rq/Oh8VWs1Yh</code>
<code>mysql5.7的資料庫初始化如下:</code>
<code></code>
<code>shell>/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/</code>
mysql5.7會生成一個初始化密碼,而在之前的版本首次登陸不需要登入。
<code>shell> cat /root/.mysql_secret </code>
<code># Password set for user 'root@localhost' at 2015-04-22 22:13:23 </code>
<code>?G5W&tz1z.cN</code>
<code>修改預設密碼</code>
<code>shell> bin/mysqladmin -h localhost -u root password </code><code>'123@qwe'</code> <code>-p</code><code>'?G5W&tz1z.cN'</code>
<code>mysqladmin: [Warning] Using a password on the command line interface can be insecure.</code>
<code>Warning: Since password will be sent to server </code><code>in</code> <code>plain text, use ssl connection to ensure password safety.</code>
另外mysql5.7的mysql.user表結構被修改
<code>修改mysql.user方式修改密碼</code>
<code>mysql> update mysql.user set authentication_string=password(</code><code>'123qwe'</code><code>) where user=</code><code>'svoid'</code> <code>and Host = </code><code>'localhost'</code><code>;</code>
<code>Query OK, 1 row affected (0.01 sec)</code>
<code>Rows matched: 1 Changed: 1 Warnings: 0</code>
<code>mysql> flush privileges;</code>
<code>Query OK, 0 rows affected (0.00 sec)</code>
整理自:http://blog.itpub.net/29733787/viewspace-1590891/
本文轉自MQ_douer 51CTO部落格,原文連結:http://blog.51cto.com/douer/1922603,如需轉載請自行聯系原作者