iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >如何在MySQL中修改innodb_data_file_path参数事项
  • 677
分享到

如何在MySQL中修改innodb_data_file_path参数事项

2024-04-02 19:04:59 677人浏览 独家记忆
摘要

如何在Mysql中修改innodb_data_file_path参数事项?很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。在测试环

如何在Mysql中修改innodb_data_file_path参数事项?很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

测试环境下没有设置过多的详细参数就初始化并启动了服务,后期优化的过程中发现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)]>

当没有配置innodb_data_file_path时,默认innodb_data_file_path = ibdata1:12M:autoextend

[mysqld]
innodb_data_file_path = ibdata1:12M:autoextend

当需要改为1G时,不能直接在配置文件把 ibdata1 改为 1G ,

[mysqld]
innodb_data_file_path = ibdata1:1G:autoextend

否则启动服务之后,从错误日志看到如下报错:

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!

大致意思就是ibdata1的大小不是 65536page*16KB/1024KB=1G ,而是 786page*16KB/1024KB=12M
(未使用压缩页)

方法一:推荐

而应该再添加一个 ibdata2:1G ,如下:

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

重启数据库

方法二:不推荐

直接改为如下的话

[mysqld]
innodb_data_file_path = ibdata1:1G:autoextend

可以删除$mysql_datadir目录下 ibdata1、ib_logfile0、ib_logfile1 文件:

rm -f ibdata* ib_logfile*

也可以启动MySQL,但是mysql错误日志里会报如下错误:

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 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
2019-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 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
2019-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 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
2019-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 key
2019-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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html for how to resolve the issue.
2019-03-29T07:10:48.166891Z 0 [Warning] Failed to open optimizer cost constant tables

2019-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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html 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 them
2019-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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html 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 exist
2019-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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html 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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html 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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html 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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html 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 http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting.html 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.

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注编程网数据库频道,感谢您对编程网的支持。

您可能感兴趣的文档:

--结束END--

本文标题: 如何在MySQL中修改innodb_data_file_path参数事项

本文链接: https://www.lsjlt.com/news/55798.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • 如何在MySQL中修改innodb_data_file_path参数事项
    如何在MySQL中修改innodb_data_file_path参数事项?很多新手对此不是很清楚,为了帮助大家解决这个难题,下面小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。在测试环...
    99+
    2024-04-02
  • mysql修改大小写参数注意事项
    原由:数据库中原本参数lower_case_table_names的值为0,应开发要求需要修改为不区分大小写,即修改为1。但是修改完之后,发现本来建立的大写字母的表查不到。 修改过程 1,在参数文件中修改l...
    99+
    2024-04-02
  • 如何在mysql中修改数据库名
    如何在mysql中修改数据库名?针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。方法:一般我们选择通过修改表名称来间接实现修改数据库名称。创建新库:create da...
    99+
    2023-06-14
  • 如何修改redis参数
    修改redis参数的示例:通过redis服务端的终端命令行窗口修改。//修改redis运行参数[root@redis1 utils]# cp /etc/redis/6379.conf /root/6379.conf //可以先备份一份,防止...
    99+
    2024-04-02
  • mysql修改数据要注意哪些事项
    在修改MySQL数据时,需要注意以下几点事项: 确保备份数据:在进行数据修改之前,务必备份数据,以防意外情况发生导致数据丢失。 ...
    99+
    2024-04-28
    mysql
  • mysql中怎么修改日志参数
    这期内容当中小编将会给大家带来有关mysql中怎么修改日志参数,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。mysql,修改了配置文件,增加了日志文件的参数innodb_...
    99+
    2024-04-02
  • Linux系统中如何修改swappiness参数
    这篇文章主要为大家展示了“Linux系统中如何修改swappiness参数”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Linux系统中如何修改swappiness参数”这篇文章吧。Linux系...
    99+
    2023-06-27
  • mysql中如何修改事务隔离级别
    小编给大家分享一下mysql中如何修改事务隔离级别,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧! 修改方法:1、在命令窗口中执行“set session tra...
    99+
    2024-04-02
  • vue如何修改路由参数
    在vue中修改路由参数的方法:1.新建项目,引入vue和vue-router;2.使用Vue.use注册路由;3.定义和配置路由;4.使用merge模块修改路由参数;具体步骤如下:首先,在新建一个html项目,并在项目中引入vue和vue-...
    99+
    2024-04-02
  • linux如何修改系统参数
    这篇文章将为大家详细讲解有关linux如何修改系统参数,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。vi /etc/security/limits.confvi /etc...
    99+
    2024-04-02
  • 如何在phpmyadmin中修改mysql密码
    小编给大家分享一下如何在phpmyadmin中修改mysql密码,希望大家阅读完这篇文章后大所收获,下面让我们一起去探讨吧!单击上图中的“用户”,如图,可看到当前所有用户选择最后一行,root localh...
    99+
    2024-04-02
  • 在fusionio上mysql几个参数的修改说明
    在Fusion-io上修改MySQL的几个参数可以提高性能和优化数据库的运行。以下是几个常用参数的修改说明:1. innodb_io...
    99+
    2023-08-23
    mysql
  • 如何在Navicat中修改MySQL数据库的密码
    本篇文章为大家展示了如何在Navicat中修改MySQL数据库的密码,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。方法1: 用SET PASSWORD命令 首先登录...
    99+
    2024-04-02
  • 如何修改Linux内核参数vm.swappiness
    目录修改linux内核参数vm.swappiness调整vm.swappiness的方法了解vm.swappiness使用交换vm.swappiness小结一下吧总结修改Linux内核参数vm.swappiness 内核...
    99+
    2023-02-10
    修改Linux内核参数 vm.swappiness Linux内核参数
  • Windows下如何修改Tomcat jvm参数
    这篇文章主要介绍“Windows下如何修改Tomcat jvm参数”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“Windows下如何修改Tomcat jvm参数”文章能帮助大家解...
    99+
    2023-07-05
  • vue如何动态修改$router参数
    目录vue动态修改$router参数动态修改router路由所带参数vue动态修改$router参数 // 创建一个包含当前 URL 参数的对象 export const getUR...
    99+
    2024-04-02
  • mysql如何修改表中的数据
    要修改MySQL表中的数据,可以使用UPDATE语句。以下是修改表中数据的基本语法: UPDATE 表名 SET 列名1 = 值1,...
    99+
    2024-04-09
    mysql
  • mysql中比较有用的复制参数修改
    这篇文章将为大家详细讲解有关mysql中比较有用的复制参数修改,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。 忽略某个库replicate-...
    99+
    2024-04-02
  • 如何在Java项目中使用args参数数组
    如何在Java项目中使用args参数数组?相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。传递普通参数public class Test { ...
    99+
    2023-06-06
  • mysql如何修改事务隔离级别
    小编给大家分享一下mysql如何修改事务隔离级别,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!用户可以用SET TRANSACT...
    99+
    2024-04-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作