基于WHM的CentOS 7.9上的MySQL8.0.23
最后,我得到了一个损坏的InnoDB表。我放弃了一个很长的问题然后杀了它。然后查询仍然阻塞,所以我重新启动了一个强有力的服务器。我现在知道了,查询仍然是阻塞的,因为它正在取消进程。用一个强大的服务器重新引导它会破坏我的数据库。剩下的都是历史了。
所以我一直在努力完成这个过程:https://dev.iserversupport.com/recover-crashed-innodb-tables-on-mysql-database-server/
但是MySQL似乎不想重新创建ibdata1文件。
my.cnf:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
[mysqld] disable-log-bin=1 default-authentication-plugin=mysql_native_password performance-schema=0
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove the leading "# " to disable binary logging
# Binary logging captures changes between backups and is enabled by
# default. It's default setting is log_bin=binlog
# disable_log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
#
# Remove leading # to revert to previous value for default_authentication_plugin,
# this will increase compatibility with older clients. For background, see:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
# default-authentication-plugin=mysql_native_password
datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid innodb_file_per_table=1
default-storage-engine=MyISAM interactive_timeout=300 key_cache_block_size=4096 max_heap_table_size=5G max_join_size=1000000000 max_allowed_packet=268435456 open_files_limit=40000 thread_cache_size=100 tmp_table_size=5G wait_timeout=7800 max_user_connections=500 myisam_recover_options=FORCE innodb_file_per_table=1 innodb_flush_log_at_trx_commit=0 innodb_purge_threads=1 innodb_thread_concurrency=8 pid-file=/var/lib/mysql/mysqld.pid
performance-schema=0 sql_mode='' interactive_timeout=30 wait_timeout=90
collation-server = utf8_unicode_ci character-set-server=utf8
key_buffer_size = 4G innodb_buffer_pool_size = 8G innodb_buffer_pool_chunk_size = 256M innodb_buffer_pool_instances = 8
max_connections=300
和错误日志:
2021-01-19T18:18:18.543601Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2021-01-19T18:18:18.543714Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2021-01-19T18:18:18.543792Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2021-01-19T18:18:18.543895Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2021-01-19T18:18:18.543986Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2021-01-19T18:18:19.908326Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.23) starting as process 1777
2021-01-19T18:18:19.909547Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2021-01-19T18:18:19.909570Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8_unicode_ci' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
2021-01-19T18:18:19.959205Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
这使我认为我有所有权或读/写权限错误。但是我检查了/var/lib/mysql目录的所有权,它是mysql:mysql,权限是751。
我可以通过强制innodb_force_recovery = 3恢复我的所有数据,但是现在我已经删除了那些ibd文件,所以我无法让服务器以任何方式重新启动。我确实支持过他们,我也试过把他们复制回来,但没有骰子。
我还试图通过WHM重新安装mysql。但失败了。
谢谢马特
发布于 2021-01-20 19:35:36
我最终通过删除/var/lib/mysql目录并运行
mysqld --initialize --datadir=/var/lib/mysql
https://dba.stackexchange.com/questions/283598
复制相似问题