mysql_install_db伊始化不读取my

前言

1.1.1. mysql5.6.14多实例my.cnf时,伊始化不读取my.cnf配置文件

innodb_data_file_path用来钦点innodb
tablespace文件,假诺我们不在My.cnf文件中内定innodb_data_home_dir和innodb_data_file_path那么暗中认可会在datadir目录下创立ibdata1
作为innodb tablespace。

【蒙受描述】

说明

金沙js8331,在多实例配置的/etc/my.cnf情形中,实行mysql_install_db后,启动Mysql报错。

在测验情况下并未有设置过多的详实参数就初阶化并运营了劳务,早先时期优化的历程中发觉innodb_data_file_path设置过小:

【操作步骤】

root@node1 14:59: [(none)] show variables like '%innodb_data_file_path%';+-----------------------+------------------------+| Variable_name | Value |+-----------------------+------------------------+| innodb_data_file_path | ibdata1:12M:autoextend |+-----------------------+------------------------+1 row in set (0.00 sec)root@node1 14:59: [(none)]

mysql_install_db伊始化不读取my。/etc/my.cnf配置文件:

当未有安插innodb_data_file_path时,默认innodb_data_file_path = ibdata1:12M:autoextend

[mysqld3307]

[mysqld]innodb_data_file_path = ibdata1:12M:autoextend

innodb_data_file_path =ibdata1:1G:autoextend

当供给改为1G时,无法一贯在配置文件把 ibdata1 改为 1G ,

伊始化数据库:

[mysqld]innodb_data_file_path = ibdata1:1G:autoextend

[[email protected]
home]# mysql_install_db–datadir=/home/mysql_3307 –user=mysql
–defaults-file=/etc/my.cnf

不然运营服务之后,从错误日志看见如下报错:

Installing MySQL system tables…2014-05-1311:07:33 0 [Warning]
TIMESTAMP with implicit DEFAULT value is deprecated.Please use
–explicit_defaults_for_timestamp server option (see documentationfor
more details).

2019-03-29T06:47:32.044316Z 0 [ERROR] InnoDB: The Auto-extending
innodb_system data file ‘./ibdata1’ is of a different size 768 pages
(rounded down to MB) than specified in the .cnf file: initial 65536
pages, max 0 (relevant if non-zero) pages!

2014-05-13 11:07:33 8897 [Note] InnoDB: TheInnoDB memory heap is
disabled

粗粗意思便是ibdata1的分寸不是 65536page*16KB/1024KB=1G,而是
786page*16KB/1024KB=12M

2014-05-13 11:07:33 8897 [Note] InnoDB:Mutexes and rw_locks use GCC
atomic builtins

方法一:推荐

2014-05-13 11:07:33 8897 [Note] InnoDB:Compressed tables use zlib
1.2.3

而相应再增多八个 ibdata2:1G ,如下:

2014-05-13 11:07:33 8897 [Note] InnoDB:Using Linux native AIO

[mysqld]innodb_data_file_path = ibdata1:12M;ibdata2:1G:autoextend

2014-05-13 11:07:33 8897 [Note] InnoDB:Using CPU crc32 instructions

重启数据库!

2014-05-13 11:07:34 8897 [Note] InnoDB:Initializing buffer pool, size
= 128.0M

方法二:不推荐

2014-05-13 11:07:34 8897 [Note] InnoDB:Completed initialization of
buffer pool

直接改为如下的话

2014-05-13 11:07:34 8897 [Note] InnoDB: Thefirst specified data file
./ibdata1 did not exist: a new database to becreated!

[mysqld]innodb_data_file_path = ibdata1:1G:autoextend

2014-05-13 11:07:34 8897 [Note] InnoDB:Setting file ./ibdata1 size to
12 MB

能够去除$mysql_datadir目录下 ibdata1、ib_logfile0、ib_logfile1 文件:

2014-05-13 11:07:34 8897 [Note] InnoDB:Database physically writes the
file full: wait…

rm -f ibdata* ib_logfile*

2014-05-13 11:07:34 8897 [Note] InnoDB:Setting log file
./ib_logfile101 size to 48 MB

也足以运维MySQL,可是mysql错误日志里会报如下错误:

2014-05-13 11:07:34 8897 [Note] InnoDB:Setting log file ./ib_logfile1
size to 48 MB

2019-03-29T07:10:47.844560Z 0 [Warning] Could not increase number of max_open_files to more than 5000 (request: 65535)2019-03-29T07:10:47.844686Z 0 [Warning] Changed limits: table_open_cache: 1983 (requested 2000)2019-03-29T07:10:48.028262Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.2019-03-29T07:10:48.147653Z 0 [Warning] InnoDB: Cannot open table mysql/plugin from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to  for how to resolve the issue.mysqld: Table 'mysql.plugin' doesn't exist2019-03-29T07:10:48.147775Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.2019-03-29T07:10:48.163444Z 0 [Warning] InnoDB: Cannot open table mysql/gtid_executed from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to  for how to resolve the issue.mysqld: Table 'mysql.gtid_executed' doesn't exist2019-03-29T07:10:48.163502Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2019-03-29T07:10:48.163658Z 0 [Warning] InnoDB: Cannot open table mysql/gtid_executed from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to  for how to resolve the issue.mysqld: Table 'mysql.gtid_executed' doesn't exist2019-03-29T07:10:48.163711Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2019-03-29T07:10:48.164619Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key2019-03-29T07:10:48.166805Z 0 [Warning] InnoDB: Cannot open table mysql/server_cost from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to  for how to resolve the issue.2019-03-29T07:10:48.166891Z 0 [Warning] Failed to open optimizer cost constant tables2019-03-29T07:10:48.168072Z 0 [Warning] InnoDB: Cannot open table mysql/time_zone_leap_second from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to  for how to resolve the issue.2019-03-29T07:10:48.168165Z 0 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them2019-03-29T07:10:48.169454Z 0 [Warning] InnoDB: Cannot open table mysql/servers from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to  for how to resolve the issue.2019-03-29T07:10:48.169527Z 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist2019-03-29T07:10:48.170042Z 0 [Warning] InnoDB: Cannot open table mysql/slave_master_info from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to  for how to resolve the issue.2019-03-29T07:10:48.170617Z 0 [Warning] InnoDB: Cannot open table mysql/slave_relay_log_info from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to  for how to resolve the issue.2019-03-29T07:10:48.170946Z 0 [Warning] InnoDB: Cannot open table mysql/slave_master_info from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to  for how to resolve the issue.2019-03-29T07:10:48.171046Z 0 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened.2019-03-29T07:10:48.171272Z 0 [Warning] InnoDB: Cannot open table mysql/slave_worker_info from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to  for how to resolve the issue.2019-03-29T07:10:48.171626Z 0 [Warning] InnoDB: Cannot open table mysql/slave_relay_log_info from the internal data dictionary of InnoDB though the .frm file for the table exists. Please refer to  for how to resolve the issue.2019-03-29T07:10:48.171688Z 0 [Warning] Info table is not ready to be used. Table 'mysql.slave_relay_log_info' cannot be opened.

2014-05-13 11:07:35 8897 [Note] InnoDB:Renaming log file
./ib_logfile101 to ./ib_logfile0

总结

2014-05-13 11:07:35 8897 [Warning] InnoDB:New log files created,
LSN=45781

上述正是这篇小说的全体内容了,希望本文的剧情对我们的求学或许干活有所自然的参阅学习价值,多谢大家对剧本之家的支持。

2014-05-13 11:07:35 8897 [Note] InnoDB:Doublewrite buffer not found:
creating new

2014-05-13 11:07:35 8897 [Note] InnoDB:Doublewrite buffer created

启动mysql实例时,error.log报错:

2014-05-13 11:11:15 8989 [Note] InnoDB:Completed initialization of
buffer pool

2014-05-13 11:11:15 8989 [ERROR] InnoDB: auto-extending data file
./ibdata1 is of a differentsize 768 pages (rounded down to MB) than
specified in the .cnf file: initial65536 pages, max 0 (relevant if
non-zero) pages!

2014-05-13 11:11:15 8989 [ERROR] InnoDB:Could not open or create the
system tablespace. If you tried to add new datafiles to the system
tablespace, and it failed he

re, you should now editinnodb_data_file_path in my.cnf back to what
it was, and remove the new ibdatafiles InnoDB created in this failed
attempt. InnoDB only wrote

those files full of zeros, but did not yetuse them in any way. But be
careful: do not remove old data files which containyour precious data!

2014-05-13 11:11:15 8989 [ERROR] Plugin’InnoDB’ init function returned
error.

2014-05-13 11:11:15 8989 [ERROR] Plugin’InnoDB’ registration as a
STORAGE ENGINE failed.

2014-05-13 11:11:15 8989 [ERROR]Unknown/unsupported storage engine:
InnoDB

2014-05-13 11:11:15 8989 [ERROR] Aborting

2014-05-13 11:11:15 8989 [Note] Binlog end

2014-05-13 11:11:15 8989 [Note] Shuttingdown plugin ‘partition’

2014-05-13 11:11:15 8989 [Note] Shuttingdown plugin ‘ARCHIVE’

固然如此实行mysql_install_db命令的时候钦赐了读取/etc/my.cnf配置文件,可是进展初阶化创设数据库的时候,实际上未有读取:

初阶化时的出口日志:

2014-05-13 11:07:34 8897 [Note] InnoDB:Setting file ./ibdata1 size to
12 MB

查看/home/mysql_3307/ibdata1的大小:

[[email protected]
test mysql_3307]# ls -ltrh |grep ibdata1

-rw-rw—- 1 mysql mysql 12M May 13 11:07 ibdata1

能够开采其实成立的ibdata1文件大小也是mysql暗中认可的12M,而非配置文件中配备的1G抑扬顿挫,在运营实例时遇上的报错,也是说ibdata1文件大小跟配置文件中的不一样盟。

【报错原因】

在mysql5.6.14版本中,mysql_install_db命令读取my.cnf配置文件时,只会读取[mysqld]布置模块,它不会读取多实例中配备的[mysqldNNN],所以在该案例中,即便my.cnf配置了ibdata大小为1G,然而mysql仍旧采用暗许的12M。

【解决办法】

修改my.cnf,把[mysqldNNN]各样纠正为[mysqld],试行完发轫化之后,在把它改过回去。

【大概的别的原因】

互连网有出于datadir路线空间不足导致的报错,可是除非my.cnf中配置的ibdata异常的大,平日在线上情形不会生出的。

.
mysql5.6.14多实例my.cnf时,起头化不读取my.cnf配置文件 【情状描述】
在多实例配置的/etc/my.cnf意况中,试行mysql_install_db后,启动Mysql报错…

发表评论

电子邮件地址不会被公开。 必填项已用*标注