问题:
在初始化mysql数据时,总是突然停止了。但是没有报更多的错误。初始化命令执行后结果是killed
如下:
bin/mysqld --defaults-file=/home/fulei/mysql/conf/my.cnf --initialize --user='fulei'
killed
后来研究配置情况,发现有一项配置,innodb_buffer_pool_size配置了16G,而我的机器只有2G。
所以果断修改了这个参数为512M,初始化成功。
具体配置如下:
[mysqld]
port = 3306
basedir = /home/fulei/mysql
datadir = /home/fulei/mysql/data
tmpdir = /home/fulei/mysql/tmp
socket = /home/fulei/mysql/var/mysql.sock
pid-file = /home/fulei/mysql/var/mysql.pid
slow_query_log_file = /home/fulei/mysql/log/slow.log
log_error = /home/fulei/mysql/log/error.log
sql_mode = STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION
explicit_defaults_for_timestamp = off
innodb_buffer_pool_size = 512M
max_connections = 32000
max_connect_errors = 2000
max_allowed_packet = 30M
skip-grant-tables
[mysql]
default-character-set = utf8
socket = /home/fulei/mysql/var/mysql.sock
[client]
default-character-set = utf8
socket = /home/fulei/mysql/var/mysql.sock
[mysqld_safe]
log-error = /home/fulei/mysql/log/mariadb.log
pid-file = /home/fulei/mysql/var/mariadb.pid