编译安装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、报错如下:
[root@oracle mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/mysqldata/3306/data
2018-11-07T08:41:21.959792Z 0 [Waing] '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 [Waing] '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' ;
4、service mysql start时报错如下:
[root@pdata-svr115 local]# service mysql start
Starting MySQL... ERROR! The server quit without updating PID file (/mysqldata/3306/mysql.pid).
解决方法:
1.可能是/usr/local/mysql/data/rekfan.pid文件没有写的权限
解决方法 :给予权限,执行 “chown -R mysql:mysql /var/data” “chmod -R 755 /usr/local/mysql/data” 然后重新启动mysqld!
2.可能进程里已经存在mysql进程
解决方法:用命令“ps -ef|grep mysqld”查看是否有mysqld进程,如果有使用“kill -9 进程号”杀死,然后重新启动mysqld!
3.可能是第二次在机器上安装mysql,有残余数据影响了服务的启动。
解决方法:去mysql的数据目录/data看看,如果存在mysql-bin.index,就赶快把它删除掉吧,它就是罪魁祸首了。本人就是使用第三条方法解决的 !http://blog.rekfan.com/?p=186
4.mysql在启动时没有指定配置文件时会使用/etc/my.cnf配置文件,请打开这个文件查看在[mysqld]节下有没有指定数据目录(datadir)。
解决方法:请在[mysqld]下设置这一行:datadir = /usr/local/mysql/data
5.skip-federated字段问题
解决方法:检查一下my.cnf文件中有没有没被注释掉的skip-federated字段,如果有就立即注释掉吧。
6.错误日志目录不存在
解决方法:使用“chown” “chmod”命令赋予mysql所有者及权限
7.selinux惹的祸,如果是centos系统,默认会开启selinux
解决方法:关闭它,打开/etc/selinux/config,把SELINUX=enforcing改为SELINUX=disabled后存盘退出重启机器试试。
我解决的方法是注释掉my.cnf文件不适用的字段,一下是文件内容可供参考:
#The MySQL client[client]port=3306socket=/mysqldata/3306/mysql.sock#default-charcter-set=utf8#The MySQL server[mysqld]port=3306user=mysqlsocket=/mysqldata/3306/mysql.sockpid-file=/mysqldata/3306/mysql.pidbasedir=/usr/local/mysqldatadir=/mysqldata/3306/datatmpdir=/mysqldata/3306/tmpopen_files_limit=10240explicit_defaults_for_timestamp#Buffermax_allowed_packet=256Mmax_heap_table_size=256Mnet_buffer_length=8Ksort_buffer_size=2Mjoin_buffer_size=4Mread_buffer_size=2Mread_d_buffer_size=16M#Loglog-bin=/mysqldata/3306/binlog/mysql-binbinlog_cache_size=32Mmax_binlog_cache_size=512Mmax_binlog_size=512Mbinlog_format=mixedlog_output=FILElog-error=../mysql-error.logslow_query_log=1slow_query_log_file=../slow_query.loggeneral_log=0general_log_file=../general_query.logexpire-logs-days=14#InnoDBinnodb_data_file_path=ibdata1:2048M:autoextendinnodb_log_file_size=256Minnodb_log_files_in_group=3innodb_buffer_pool_size=1024Mcharacter-set-server=utf8#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLESserver-id=1max_connections=1000wait_timeout=30interactive_timeout = 30lower_case_table_names=1#skip-grant-tables[mysql]no-auto-rehashprompt=(\u@\h) [\d]>\_#default-character-set=utf8##character_set_server=utf8
微信

支付宝

作者:西门运维
来源链接:https://www.cnblogs.com/Dev0ps/p/9924616.html
版权声明:
1、JavaClub(https://www.javaclub.cn)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。
2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。