找回密码
 立即注册
查看: 6673|回复: 0

MySQL5.7源码安装问题汇总

[复制链接]
发表于 2015-12-1 16:13:16 | 显示全部楼层 |阅读模式
cmake版本# p3 j% W# R/ V: g/ U

/ H. Z" d4 D3 z  `5.7编译cmake要求版本最低为2.8,当前为2.6,所以需要升级cmake版本。+ |) W3 V) S1 t8 Z- M3 d" h' B( z& A
[mw_shl_code=applescript,true]shell> cmake . -DCMAKE_INSTALL_PREFIX=/db/mysql/mysql_57 -DMYSQL_DATADIR=/db/mysql/mysql_57/data
0 [" T* y% k. h$ N# j2 I" FCMake Error at CMakeLists.txt:21 (CMAKE_MINIMUM_REQUIRED):
6 ?" b. \$ a& L5 |  CMake 2.8.2 or higher is required.  You are running version 2.6.4
6 @: b0 `8 m! g/ n4 g3 h2 U" X0 u-- Configuring incomplete, errors occurred!" g# {2 G1 J6 p) P. F' W: @9 l1 R6 z
$ g/ P0 t0 m% N" g( S5 Q$ R  v/ y
shell> cmake --version
& i* u( O  @7 u0 dcmake version 2.6-patch 4
( I7 Q2 w8 E" _0 @$ `
3 ]& D- M8 b: m- Q6 N$ B: ccmake官网下载地址
& W' S3 G4 u0 ~2 J# T$ h* r8 K7 k/ E/ }$ i' K& Q# H2 _- j( ], v
shell> tar zxvf cmake-3.2.2.tar.gz! T& R! S  R6 i
shell> cd cmake-3.2.2/
$ U  A" {& W. ]. L3 O/ O5 M4 xshell> ./bootstrap
/ b' t4 ^9 @1 N8 X. Tshell> make && make install
9 r2 E# w8 H- X+ [1 U, a# ]; x: K6 Y
shell> cmake --version
, r# V$ A+ h5 f! E  Lcmake version 3.2.2[/mw_shl_code]
3 q: L6 ?3 B7 m5 _  R. B
. y. L+ {9 k! J# FBOOST库
8 ]; U" |9 m, J5 B; A8 K+ v
% w6 A; p& f. V  S5.7编译需要boost类库,可使用 -DDOWNLOAD_BOOST=1 -DWITH_BOOST= 参数将在指定路径查找,如未找到会指定下载并解压到指定的路径: D7 E% Z, d6 k; L
[mw_shl_code=applescript,true]问题描述
" c% t- i! a+ a: k# j4 Gshell> cmake . -DCMAKE_INSTALL_PREFIX=/db/mysql/mysql_57 -DMYSQL_DATADIR=/db/mysql/mysql_57/data
) H6 x$ |- x% O6 x( G$ ]2 f- @" ^# `
CMake suite maintained and supported by Kitware (kitware.com/cmake).
) s# L2 U8 P( i8 p* ?
& A3 A0 u7 w" K! Q
! L; b& n* E1 L& ]-- Could not find (the correct version of) boost.3 V; |8 u9 k# I6 U& V! m
-- MySQL currently requires boost_1_57_0
- U- R) F9 [& ~; f
9 ]2 W" y- ]7 X/ ^3 Z5 ?$ m$ c1 `) |CMake Error at cmake/boost.cmake:76 (MESSAGE):
( H; x4 q' W5 ?; P* n  You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=
7 e' Y3 P. K( `; _+ i5 b2 o# c+ n! X' S
安装boost库
5 l6 `" m9 ]: {" K7 R( }, X/ Z$ wshell> tar jxvf boost_1_57_0.tar.bz2- w9 }8 E* |8 K& i  Z. v' L8 u
shell> cd boost_1_57_0/
9 u2 r% e( |+ m8 ~) Xshell> ./bootstrap.sh
7 j  G3 S& E/ P9 [. Pshell> ./b2 install5 O, r7 N7 j) s

0 s2 j) f3 K2 f* E  j安装后目录
* D' n  b% s& G9 f8 `/ [7 kshell> ls /usr/local/include/
! _" W, D5 t5 h. M- U+ |boost; p1 G2 j5 B8 x" E% J& u/ t
( j( o( O5 I% e2 x7 j0 M/ C
shell> cmake . -DCMAKE_INSTALL_PREFIX=/db/mysql/mysql_57 -DMYSQL_DATADIR=/db/mysql/mysql_57/data
* t2 Y9 l- F& x" e! P: D[/mw_shl_code]
4 U0 S- M0 D6 g0 o% gmysql_install_db# f) D4 f2 w( E) ~$ p" ]
之前版本mysql_install_db是在mysql_basedir/script下,5.7放在了mysql_install_db/bin目录下,且已被废弃。6 o/ G9 F8 C# B
[mw_shl_code=applescript,true]shell> cd /db/mysql/mysql_57
. t. `* N9 c9 ~shell> bin/mysql_install_db --basedir=. --datadir=data --user=mysql
2 d7 {# c% [( D, w! {* {2 b[WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
! U4 c; P6 n8 x& _5 ^# m( v& z, L* N5 Q/ {3 u$ m: \, U
shell> bin/mysqld --initialize1 T0 i7 [( A. x0 O, ]% ~
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).
3 j8 p% v9 ?0 l- @% t2015-04-21T18:17:58.702510Z 0 [Warning] InnoDB: New log files created, LSN=45790) F7 q- X# @2 e3 X
2015-04-21T18:17:59.538811Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
" U; @* S1 t: ?2 R- k5 f6 t2015-04-21T18:17:59.646010Z 0 [Warning] Failed to setup SSL6 r+ `/ N! C  w* Y( \
2015-04-21T18:17:59.646105Z 0 [Warning] SSL error: SSL context is not usable without certificate and private key3 q- J3 b) @! g6 Q+ h
2015-04-21T18:17:59.663795Z 1 [Warning] A temporary password is generated for root@localhost: rq/Oh8VWs1Yh. }: }( Z1 |- p0 |. m
[/mw_shl_code]
# q8 k) d  K3 H! `" x6 b0 E0 N* x) s) c, e. P
初始化密码
8 W9 w0 x9 G1 h' ?mysql5.7会生成一个初始化密码,而在之前的版本首次登陆不需要登录。8 O3 m9 r& x0 b4 q5 b
[mw_shl_code=applescript,true]shell> cat /root/.mysql_secret
! z  C% ]! Q$ c- t- S2 V6 k# Password set for user 'root@localhost' at 2015-04-22 22:13:23
9 e2 |. ]3 I" @6 H( G% b5 A?G5W&tz1z.cN
) Y* V' c! D4 k3 O3 }9 f' d+ Y, S5 ~/ A1 X
修改默认密码) Y( R" [2 D$ Q+ G6 g
shell> bin/mysqladmin -h localhost -u root password '123@qwe' -p'?G5W&tz1z.cN'0 r, u* t  R/ q+ y" ?3 i2 l
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
0 ]1 R: B4 W; P% E9 @& QWarning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
3 x  F: c5 O: n5 U- \4 F9 k7 m" m
! B9 s# i: v% B) i( I( D5 @$ T
" M; @, t4 x" J另外mysql5.7的mysql.user表结构被修改
) N0 ]/ S( O/ H7 ^4 @* \9 D* M1 {7 y2 [& d8 G
修改mysql.user方式修改密码% s# g( T6 [' Y

. ~) z% r( v1 ^0 j5 Q8 lmysql> update mysql.user set authentication_string=password('123qwe') where user='svoid' and Host = 'localhost';, k( C6 C" f% Q& R- }+ S
Query OK, 1 row affected (0.01 sec), A$ X+ Y' e  T  Q
Rows matched: 1  Changed: 1  Warnings: 0  w3 s  O6 S- P. b5 ]9 {. n
5 A: x  E3 e6 k5 t7 X1 T
mysql> flush privileges;9 z/ g9 e) z- Z
Query OK, 0 rows affected (0.00 sec)[/mw_shl_code]
0 h+ l4 E  E: Q; r4 N7 w7 S+ I' M/ e
& O; D8 t, A4 f$ ], b7 N  q  h  s
# u  P  ?# r2 u: O6 B
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-4-20 01:07 , Processed in 0.066603 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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