1 安装问题
1.1 初始化问题
如果mysqld命令无法识别数据目录,则需要添加如下参数 --basedir=/opt/mysql/mysql --datadir=/opt/mysql/mysql/data后重新初始化。或者使用my.cnf配置文件,文件中添加:
[mysqld]
basedir=/opt/mysql/mysql
datadir=/opt/mysql/mysql/data
并在初始化命令中指定cnf文件后,重新初始化。bin/mysqld --defaults-file=/opt/mysql/mysql/etc/my.cnf --initialize --user=mysql
提示错误libnuma.so.1: cannot open shared object file
[root@VM-0-7-centos mysql]# bin/mysqld --initialize --user=mysql
bin/mysqld: error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or directory
[root@VM-0-7-centos mysql]#
如果安装mysql出现了以上的报错信息。这是却少numactl这个时候,如果是Centos就yum -y install numactl就可以解决这个问题了;ubuntu的就sudo apt-get install numactl就可以解决这个问题了。
1.2 启动问题
mysqld_safe启动无法找到日志文件
[root@VM-0-7-centos bin]# ./mysqld_safe --user=mysql &
[1] 21117
[root@VM-0-7-centos bin]# 2021-02-09T05:40:14.022063Z mysqld_safe error: log-error set to '/var/log/mariadb/mariadb.log', however file don't exists. Create writable for user 'mysql'.
[1]+ Exit 1 ./mysqld_safe --user=mysql
[root@VM-0-7-centos bin]#
解决方法:
[root@VM-0-7-centos bin]# mkdir -p /var/log/mariadb/