编译安装mysql5.7.24踩的坑
Posted Louis He
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了编译安装mysql5.7.24踩的坑相关的知识,希望对你有一定的参考价值。
1、报错如下:
CMake Error at cmake/boost.cmake:76 (MESSAGE):
You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory>
This CMake script will look for boost in <directory>. If it is not there,
it will download and unpack it (in that directory) for you.
If you are inside a firewall, you may need to use an http proxy:
export http_proxy=http://example.com:80
Call Stack (most recent call first):
cmake/boost.cmake:228 (COULD_NOT_FIND_BOOST)
CMakeLists.txt:435 (INCLUDE)
-- Configuring incomplete, errors occurred!
See also "/byrd/tools/mysql-5.7.9/CMakeFiles/CMakeOutput.log".
解决方法:编译时添加红色部分
cmake . -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}
-DDEFAULT_CHARSET=UTF8
-DDEFAULT_COLLATION=utf8_general_ci
-DENABLED_LOCAL_INFILE=ON
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_FEDERATED_STORAGE_ENGINE=1
-DWITH_BLACKHOLE_STORAGE_ENGINE=1
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1
-DWITH_PARTITION_STORAGE_ENGINE=1
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1
-DCOMPILATION_COMMENT=‘dxmysql‘
-DWITH_READLINE=ON
-DSYSCONFDIR=/mysqldata/3306
-DDOWNLOAD_BOOST=1
-DWITH_BOOST=/usr/local/boost
-DMYSQL_UNIX_ADDR=/mysqldata/3306/mysql.sock
2、报错如下:
[[email protected] mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/mysqldata/3306/data
2018-11-07T08:41:21.959792Z 0 [Warning] ‘NO_ZERO_DATE‘, ‘NO_ZERO_IN_DATE‘ and ‘ERROR_FOR_DIVISION_BY_ZERO‘ sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2018-11-07T08:41:21.959848Z 0 [Warning] ‘NO_AUTO_CREATE_USER‘ sql mode was not set.
2018-11-07T08:41:21.961486Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
解决方法:清空数据目录,再执行初始化命令即可
rm -fr /mysqldata/3306/data/*
3、修改密码时报错如下:
([email protected]) [mysql]> update user set password=password("newpassword") where user=‘root‘;
ERROR 1054 (42S22): Unknown column ‘password‘ in ‘field list
解决方法:mysql5.7.x数据库下已经没有password这个字段了,password字段改成了authentication_string,即可
([email protected]) [mysql]> update mysql.user set authentication_string=password(‘root‘) where user=‘root‘ ;
以上是关于编译安装mysql5.7.24踩的坑的主要内容,如果未能解决你的问题,请参考以下文章