mysql编译问题合集

数据库遇到的问题合集

1.--initialize specified but the data directory has files in it. Aborting 检查你的mysql/data(目录也可能在其他地方)目录下是否有数据,如果有请清空,再执行初始化 2.Fatal error: Can't change to run as user 'mysql' ; Please check that the user exists!

# 新建mysql用户和用户组
$ groupadd -r mysql && useradd -r -g mysql -s /sbin/nologin -M mysql

3.MySQL is not running, but lock file (/var/lock/subsys/mysql[FAILED] 可能和log文件有关系,移除log文件

$ rm -rf /var/lock/subsys/mysql
# 再重启mysql

4.用阿里云编译mysql5.7.12时在编译一半时出现错误,如下:

[ 50%] Building CXX object sql/CMakeFiles/sql.dir/item_cmpfunc.cc.o
[ 50%] Building CXX object sql/CMakeFiles/sql.dir/item_create.cc.o
[ 50%] Building CXX object sql/CMakeFiles/sql.dir/item_func.cc.o
[ 50%] Building CXX object sql/CMakeFiles/sql.dir/item_geofunc.cc.o
# 解决办法:
设置linux虚拟内存