系统运行正常,但突然出现此错误“数据库连接失败”,可能是可能的问题,如何永久修复此错误。 谢谢。
系统信息: Ubuntu 16.04.3 x64 2 GB内存/ 50 GB磁盘
I checked with 'df -h' in the terminal,
我做了错误日志检查:
2018-07-31T10:10:04.751870Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2018-07-31T10:10:34.438715Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-07-31T10:10:34.438807Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-07-31T10:10:34.613317Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-07-31T10:10:34.615293Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.23-0ubuntu0.16.04.1) starting as process 14674 ...
2018-07-31T10:10:34.620666Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-07-31T10:10:34.620694Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-07-31T10:10:34.620699Z 0 [Note] InnoDB: Uses event mutexes
2018-07-31T10:10:34.620703Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-07-31T10:10:34.620706Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-07-31T10:10:34.620710Z 0 [Note] InnoDB: Using Linux native AIO
2018-07-31T10:10:34.621008Z 0 [Note] InnoDB: Number of pools: 1
2018-07-31T10:10:34.621153Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-07-31T10:10:34.623069Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-07-31T10:10:34.634597Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-07-31T10:10:34.637277Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-07-31T10:10:34.647303Z 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
2018-07-31T10:10:34.647393Z 0 [ERROR] InnoDB: redo log file './ib_logfile0' exists. Creating system tablespace with existing redo log files is not recommended. Please delete all redo log files before creating new system tablespace.
2018-07-31T10:10:34.647403Z 0 [ERROR] InnoDB: InnoDB Database creation was aborted with error Generic error. You may need to delete the ibdata1 file before trying to start up again.
2018-07-31T10:10:35.248139Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-07-31T10:10:35.248186Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-07-31T10:10:35.248195Z 0 [ERROR] Failed to initialize builtin plugins.
2018-07-31T10:10:35.248201Z 0 [ERROR] Aborting
2018-07-31T10:10:35.248222Z 0 [Note] Binlog end
2018-07-31T10:10:35.248304Z 0 [Note] Shutting down plugin 'MyISAM'
2018-07-31T10:10:35.248323Z 0 [Note] Shutting down plugin 'CSV'
2018-07-31T10:10:35.248824Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
答案 0 :(得分:1)
您是否在此过程中更改了ib_logfile的大小?错误Project properties => Compile => AnyCPU
表明它找不到您的ibdata文件。您尝试了建议的Debug Mode => AnyCPU
吗?
答案 1 :(得分:1)
按照以下步骤解决该错误:
InnoDB: Unable to lock ./ibdata1, error: 11
命令是:
# cd /var/lib/mysql
# mkdir bak
# mv ibdata1 bak/.
# mv ib_logfile* bak/.
# cp -a bak/ibdata1 ibdata1
# cp -a bak/ib_logfile* .
# service mysql restart
然后我收到关于“重新启动mysql服务”的错误
,然后按照以下步骤操作:
lsof -i:3306
Then kill it (the process number)
kill -9 PROCESS
e.g. kill -9 13498
Then try to restart MySQL again.
感谢@Evgeniy和@Quiron。
答案 2 :(得分:0)
如果您告诉我们您的心情是使用LAMP,MAMP,WAMP,WIMP,XAMPP,远程托管...托管的,那将对您有帮助。
另外,如果您检查错误日志,它应该具有有关该问题的更多信息。我之前有相同的错误,数据库过载,因此更改max_execution_time的值可以解决该错误。进入config.php搜索:
upload_max_filesize = 2M或您需要的值。
max_execution_time = 60或您需要的值,该值是秒。
看到您的日志后,我会搜索您的错误,并希望它能起作用:
在配置文件/etc/mysql/my.cnf中减小innodb-buffer-pool大小的值:
innodb_buffer_pool_size = 10M
保存my.cnf后,重新启动mysql服务。
来源:Getting error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed" when starting MySQL