cmake安装mysql5.7_编译安装mysql5.7.24踩的坑

本文介绍了在使用cmake安装mysql5.7.24过程中遇到的两个主要问题及其解决方案。第一个问题是CMake在寻找boost库时出错,解决方法是在cmake命令中添加DOWNLOAD_BOOST和WITH_BOOST选项。第二个问题是在初始化数据库时遇到警告和错误,需要清空数据目录。最后,还提到了在mysql5.7中更新root用户密码时遇到的问题,由于password字段已更改为authentication_string,所以需要更新该字段的值。
摘要由CSDN通过智能技术生成

1、报错如下:

CMake Error at cmake/boost.cmake:76 (MESSAGE):

You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=

This CMake script will look for boost in .  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、报错如下:

[root@oracle 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、修改密码时报错如下:

(root@localhost) [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,即可

(root@localhost) [mysql]> update mysql.user set authentication_string=password(‘root‘) where user=‘root‘ ;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值