找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 11649|回复: 0

MySQL5.7源码安装问题汇总

[复制链接]
发表于 2015-12-1 16:13:16 | 显示全部楼层 |阅读模式
cmake版本
4 `3 ^- f; R$ a+ D6 F7 B% d* U' D! |8 K! J: J# r2 D3 E
5.7编译cmake要求版本最低为2.8,当前为2.6,所以需要升级cmake版本。
; f% p) m* S$ E! @$ R( x5 Q4 t- m
[AppleScript] 纯文本查看 复制代码
shell> cmake . -DCMAKE_INSTALL_PREFIX=/db/mysql/mysql_57 -DMYSQL_DATADIR=/db/mysql/mysql_57/data
CMake Error at CMakeLists.txt:21 (CMAKE_MINIMUM_REQUIRED):
  CMake 2.8.2 or higher is required.  You are running version 2.6.4
-- Configuring incomplete, errors occurred!

shell> cmake --version
cmake version 2.6-patch 4

cmake官网下载地址

shell> tar zxvf cmake-3.2.2.tar.gz
shell> cd cmake-3.2.2/
shell> ./bootstrap
shell> make && make install

shell> cmake --version
cmake version 3.2.2
# B; N7 A( }+ }9 ^5 n: u

+ ]' L6 `: W* C/ U: PBOOST库
8 D# p( Q1 x- H2 o
# m. @, p. S# w1 H$ w! }5.7编译需要boost类库,可使用 -DDOWNLOAD_BOOST=1 -DWITH_BOOST= 参数将在指定路径查找,如未找到会指定下载并解压到指定的路径& X* M8 h7 |; F. W8 m2 k
[AppleScript] 纯文本查看 复制代码
问题描述
shell> cmake . -DCMAKE_INSTALL_PREFIX=/db/mysql/mysql_57 -DMYSQL_DATADIR=/db/mysql/mysql_57/data 

CMake suite maintained and supported by Kitware (kitware.com/cmake).


-- Could not find (the correct version of) boost.
-- MySQL currently requires boost_1_57_0

CMake Error at cmake/boost.cmake:76 (MESSAGE):
  You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=

安装boost库
shell> tar jxvf boost_1_57_0.tar.bz2
shell> cd boost_1_57_0/
shell> ./bootstrap.sh
shell> ./b2 install

安装后目录
shell> ls /usr/local/include/
boost

shell> cmake . -DCMAKE_INSTALL_PREFIX=/db/mysql/mysql_57 -DMYSQL_DATADIR=/db/mysql/mysql_57/data
6 [/ j" h) ]8 o# B# @7 _
mysql_install_db
+ l2 \' r3 B  j* g1 R& t, k1 R0 ^之前版本mysql_install_db是在mysql_basedir/script下,5.7放在了mysql_install_db/bin目录下,且已被废弃。
" m& x) F: i2 s% D4 A6 d$ }
[AppleScript] 纯文本查看 复制代码
shell> cd /db/mysql/mysql_57
shell> bin/mysql_install_db --basedir=. --datadir=data --user=mysql
[WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize

shell> bin/mysqld --initialize
2015-04-21T18:17:53.169216Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-04-21T18:17:58.702510Z 0 [Warning] InnoDB: New log files created, LSN=45790
2015-04-21T18:17:59.538811Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-04-21T18:17:59.646010Z 0 [Warning] Failed to setup SSL
2015-04-21T18:17:59.646105Z 0 [Warning] SSL error: SSL context is not usable without certificate and private key
2015-04-21T18:17:59.663795Z 1 [Warning] A temporary password is generated for root@localhost: rq/Oh8VWs1Yh

% z8 J8 S/ P$ g+ o9 @9 B6 `* i/ E2 ]5 D) }* a: \
初始化密码! w% f  p% L" a# p5 e
mysql5.7会生成一个初始化密码,而在之前的版本首次登陆不需要登录。6 L2 k5 P7 H- n0 r- M
[AppleScript] 纯文本查看 复制代码
shell> cat /root/.mysql_secret 
# Password set for user 'root@localhost' at 2015-04-22 22:13:23 
?G5W&tz1z.cN

修改默认密码
shell> bin/mysqladmin -h localhost -u root password '123@qwe' -p'?G5W&tz1z.cN'
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.


另外mysql5.7的mysql.user表结构被修改

修改mysql.user方式修改密码

mysql> update mysql.user set authentication_string=password('123qwe') where user='svoid' and Host = 'localhost';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
3 L6 `7 U5 j" G6 N% A+ I8 \# e6 k
! ?" [  e9 x2 s6 {( N3 _5 D* J- `$ N

9 h. X7 z6 R  A! e. q6 y/ ?
0 v* t+ V7 j0 I5 e
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|第一站论坛 ( 蜀ICP备06004864号-6 )

GMT+8, 2026-6-16 09:48 , Processed in 0.065452 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表