MyException - 我的异常网
当前位置:我的异常网» MySQL » mysql 5.7安装过程中,初始化的有关问题

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

www.MyException.Cn  网友分享于:2013-09-28  浏览:0次
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不可用。因为里面保存了系统表的数据。

文章评论

老程序员的下场
老程序员的下场
如何成为一名黑客
如何成为一名黑客
总结2014中国互联网十大段子
总结2014中国互联网十大段子
2013年中国软件开发者薪资调查报告
2013年中国软件开发者薪资调查报告
编程语言是女人
编程语言是女人
一个程序员的时间管理
一个程序员的时间管理
“懒”出效率是程序员的美德
“懒”出效率是程序员的美德
Java 与 .NET 的平台发展之争
Java 与 .NET 的平台发展之争
漫画:程序员的工作
漫画:程序员的工作
写给自己也写给你 自己到底该何去何从
写给自己也写给你 自己到底该何去何从
程序员必看的十大电影
程序员必看的十大电影
10个调试和排错的小建议
10个调试和排错的小建议
不懂技术不要对懂技术的人说这很容易实现
不懂技术不要对懂技术的人说这很容易实现
程序猿的崛起——Growth Hacker
程序猿的崛起——Growth Hacker
团队中“技术大拿”并非越多越好
团队中“技术大拿”并非越多越好
程序员周末都喜欢做什么?
程序员周末都喜欢做什么?
当下全球最炙手可热的八位少年创业者
当下全球最炙手可热的八位少年创业者
程序员应该关注的一些事儿
程序员应该关注的一些事儿
如何区分一个程序员是“老手“还是“新手“?
如何区分一个程序员是“老手“还是“新手“?
旅行,写作,编程
旅行,写作,编程
老美怎么看待阿里赴美上市
老美怎么看待阿里赴美上市
那些争议最大的编程观点
那些争议最大的编程观点
每天工作4小时的程序员
每天工作4小时的程序员
中美印日四国程序员比较
中美印日四国程序员比较
看13位CEO、创始人和高管如何提高工作效率
看13位CEO、创始人和高管如何提高工作效率
Google伦敦新总部 犹如星级庄园
Google伦敦新总部 犹如星级庄园
鲜为人知的编程真相
鲜为人知的编程真相
Java程序员必看电影
Java程序员必看电影
那些性感的让人尖叫的程序员
那些性感的让人尖叫的程序员
Web开发人员为什么越来越懒了?
Web开发人员为什么越来越懒了?
5款最佳正则表达式编辑调试器
5款最佳正则表达式编辑调试器
为什么程序员都是夜猫子
为什么程序员都是夜猫子
我是如何打败拖延症的
我是如何打败拖延症的
Web开发者需具备的8个好习惯
Web开发者需具备的8个好习惯
程序员和编码员之间的区别
程序员和编码员之间的区别
10个帮程序员减压放松的网站
10个帮程序员减压放松的网站
60个开发者不容错过的免费资源库
60个开发者不容错过的免费资源库
程序员最害怕的5件事 你中招了吗?
程序员最害怕的5件事 你中招了吗?
程序员眼里IE浏览器是什么样的
程序员眼里IE浏览器是什么样的
初级 vs 高级开发者 哪个性价比更高?
初级 vs 高级开发者 哪个性价比更高?
科技史上最臭名昭著的13大罪犯
科技史上最臭名昭著的13大罪犯
程序员的鄙视链
程序员的鄙视链
程序员都该阅读的书
程序员都该阅读的书
我的丈夫是个程序员
我的丈夫是个程序员
代码女神横空出世
代码女神横空出世
聊聊HTTPS和SSL/TLS协议
聊聊HTTPS和SSL/TLS协议
为啥Android手机总会越用越慢?
为啥Android手机总会越用越慢?
“肮脏的”IT工作排行榜
“肮脏的”IT工作排行榜
程序员的一天:一寸光阴一寸金
程序员的一天:一寸光阴一寸金
软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有