专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > MySQL

mysql 5.7安装过程中,初始化的有关问题

发布时间:2010-05-20 14:01:29 文章来源:www.iduyao.cn 采编人员:星星草
mysql 5.7安装过程中,初始化的问题
初始化不指定参数文件,如使用以下命令初始化:
./mysqld --initialize --user=mysql --basedir=/data/mysql/barry_mysql --datadir=/data/mysql/barry_mysql/data
 
初始化后 ibdata1文件大小是默认的12M,如果参数文件中指定的是1G,则启动报如下错误。
2017-07-27T03:16:41.916500Z mysqld_safe Logging to '/data/mysql/barry_mysql/logs/barry-mysql.err'.
2017-07-27T03:16:42.001140Z mysqld_safe Starting mysqld daemon with databases from /data/mysql/barry_mysql/data
2017-07-27T03:16:42.158846Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2017-07-27T03:16:42.462038Z 0 [ERROR] InnoDB: The Auto-extending innodb_system data file '/data/mysql/barry_mysql/data/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!
2017-07-27T03:16:42.462105Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2017-07-27T03:16:43.563231Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-07-27T03:16:43.563302Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-07-27T03:16:43.563323Z 0 [ERROR] Failed to initialize plugins.
2017-07-27T03:16:43.563338Z 0 [ERROR] Aborting

2017-07-27T03:16:43.626546Z mysqld_safe mysqld from pid file /data/mysql/barry_mysql/tmp/mysql.pid ended

如果修改参数文件为12M,则可以正常启动。

 

如果不修改参数文件,而是将ibdata1删除,起动后会重新生成个1G的ibdata1,那么启动会报如下错误,且报错的几个表不能正常查看。

2017-07-27T03:41:16.224833Z 0 [Warning] InnoDB: New log files created, LSN=45791
mysqld: Table 'mysql.plugin' doesn't exist
mysqld: Table 'mysql.gtid_executed' doesn't exist
2017-07-27T03:41:16.371369Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-07-27T03:41:16.413614Z 0 [Warning] CA certificate ca.pem is self signed.
2017-07-27T03:38:27.049543Z 3 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2017-07-27T03:38:27.050140Z 3 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-07-27T03:40:01.619183Z mysqld_safe mysqld from pid file /data/mysql/barry_mysql/tmp/mysql.pid ended
2017-07-27T03:41:04.955142Z mysqld_safe Logging to '/data/mysql/barry_mysql/logs/barry-mysql.err'.
2017-07-27T03:41:05.040377Z mysqld_safe Starting mysqld daemon with databases from /data/mysql/barry_mysql/data
2017-07-27T03:41:05.190872Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
 100 200 300 400 500 600 700 800 900 1000
 100 200 300 400 500 600 700 800 900 1000
 100 200 300 400 500 600 700 800 900 1000
 100 200 300 400 500 600 700 800 900 1000
2017-07-27T03:41:16.224833Z 0 [Warning] InnoDB: New log files created, LSN=45791
2017-07-27T03:41:16.275795Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-07-27T03:41:16.366508Z 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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
mysqld: Table 'mysql.plugin' doesn't exist
2017-07-27T03:41:16.366637Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2017-07-27T03:41:16.371317Z 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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
mysqld: Table 'mysql.gtid_executed' doesn't exist
2017-07-27T03:41:16.371369Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-07-27T03:41:16.413614Z 0 [Warning] CA certificate ca.pem is self signed.
2017-07-27T03:41:16.415576Z 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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2017-07-27T03:41:16.415629Z 0 [Warning] Failed to open optimizer cost constant tables

2017-07-27T03:41:16.416613Z 0 [Warning] 'user' entry 'root@localhost' ignored in --skip-name-resolve mode.
2017-07-27T03:41:16.416702Z 0 [Warning] 'user' entry 'mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-07-27T03:41:16.416761Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-07-27T03:41:16.416792Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
2017-07-27T03:41:16.416986Z 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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2017-07-27T03:41:16.417023Z 0 [Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
2017-07-27T03:41:16.417647Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
2017-07-27T03:41:16.417846Z 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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2017-07-27T03:41:16.417874Z 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
2017-07-27T03:41:16.418373Z 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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2017-07-27T03:41:16.418579Z 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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2017-07-27T03:41:16.418763Z 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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2017-07-27T03:41:16.418798Z 0 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened.
2017-07-27T03:41:16.418819Z 0 [ERROR] Error in checking mysql.slave_master_info repository info type of TABLE.
2017-07-27T03:41:16.418833Z 0 [ERROR] Error creating master info: Error checking repositories.
2017-07-27T03:41:16.418842Z 0 [ERROR] Failed to create or recover replication info repository.
2017-07-27T03:41:16.418857Z 0 [ERROR] Failed to create or recover replication info repositories.

 

根据以上实验总结:

(1) 初始化的时候 应该指定参数文件,这样ibdata1就是自己设定的1G
  ./bin/mysqld --defaults-file=/data/mysql/barry_mysql/etc/my.cnf --initialize-insecure --user=mysql   
(2) ibdata1初始化后不能删除,靠重启生成的ibdata1不可用。因为里面保存了系统表的数据。
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

  • mysql服务正在启动或终止中请稍后片刻再试一次

    mysql服务正在启动或停止中请稍后片刻再试一次 启动mysql服务总是服务正在启动或停止中请稍后片刻再试一次 的提示怎么办? ...

  • mysql目录以及优化

    mysql索引以及优化 今天看到别人写的一些关于mysql索引的文章,有一些小收获,就以此开启我的随笔记录简单摘了一些重点 转载文章:http...

  • MYSQL查询今日、昨天、7天前、30天、本月数据

    MYSQL查询今天、昨天、7天前、30天、本月数据 今天: SELECT * FROM 表名 WHERE TO_DAYS( 时间字段名) = TO_DAYS(NOW()); 昨天: SEL...

  • MySQL的预加工技术

    MySQL的预处理技术 所谓的预处理技术,最初也是由MySQL提出的一种减轻服务器压力的一种技术! 传统mysql处理流程 1, 在客户端准备sql...

  • 怎么修改Xampp服务器上的mysql密码

    如何修改Xampp服务器上的mysql密码 今天自己在搞php的过程中发现,如果我们使用Xampp服务器自带数据库mysql,就必须先修改mysql的密...

  • MySQL安插emoji手机表情报错解决方案

    MySQL插入emoji手机表情报错解决方案 报错原因: 插入手机表情报错,类似 ...

  • 腾讯云装Mysql总结

    腾讯云装Mysql小结   这几天搞腾讯云服务器装mysql搞蒙了,本来还想这周就上线网站,看来不一定能行了。   总结一下吧   开...

  • MySql概念(2)

    MySql概念(二) 一、Sql规范?   sql是Structured Query Language(结构化查询语言)的缩写。SQL是专为数据库而建立的操作命令集,是一...

  • mysql主从复制原理引见

    mysql主从复制原理介绍 mysql主从复制原理 1)在mysql主库上,将改变记录到二进制日志(binary log)中。 2)在mysql从库上,IO线程将mys...

  • 如何查看和修改 MySQL 的最大连接数

    怎么查看和修改 MySQL 的最大连接数 通常,mysql的最大连接数默认是100, 最大可以达到16384。 1、查看最大连接数: show varia...

热门推荐: