记一次腾讯云wp镜像mysql挂掉的修复

环境:腾讯云轻量服务器wp镜像
问题的出现:重启一次服务器后站点打不开,wp显示无法连接数据库,后台看了下mysql没有启动
终端尝试手动启动MySQL,报错如下,网上搜了半天那个no such process报错,还是没搞定,查看/var/log/mariadb/mariadb.log,居然不存在,根本没报错日志
在这里插入图片描述
隔了几天重新尝试解决这个问题,尝试自己手动创建了/var/log/mariadb/mariadb.log,并且权限改成777,惊喜地发现解决了没报错日志的问题,但是mysql依然无法启动,查看报错日志

2023-01-19 14:56:01 0 [ERROR] mariadbd: Can't create/write to file '/www/server/mysql/aria_log_control' (Errcode: 13 "Permission denied")
2023-01-19 14:56:01 0 [ERROR] mariadbd: Got error 'Can't create file' when trying to use aria control file '/www/server/mysql/aria_log_control'
2023-01-19 14:56:01 0 [ERROR] Plugin 'Aria' init function returned error.
2023-01-19 14:56:01 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2023-01-19 14:56:01 0 [Note] InnoDB: Using Linux native AIO
2023-01-19 14:56:01 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
2023-01-19 14:56:01 0 [Note] InnoDB: Uses event mutexes
2023-01-19 14:56:01 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
2023-01-19 14:56:01 0 [Note] InnoDB: Number of pools: 1
2023-01-19 14:56:01 0 [Note] InnoDB: Using SSE4.2 crc32 instructions
2023-01-19 14:56:01 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2023-01-19 14:56:01 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456, chunk size = 134217728
2023-01-19 14:56:01 0 [Note] InnoDB: Completed initialization of buffer pool
2023-01-19 14:56:01 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-01-19 14:56:01 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2023-01-19 14:56:01 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2023-01-19 14:56:01 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2023-01-19 14:56:01 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2023-01-19 14:56:01 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
2023-01-19 14:56:01 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2023-01-19 14:56:01 0 [ERROR] InnoDB: Database creation was aborted with error Cannot open a file. You may need to delete the ibdata1 file before trying to start up again.
2023-01-19 14:56:01 0 [Note] InnoDB: Starting shutdown...
2023-01-19 14:56:01 0 [ERROR] Plugin 'InnoDB' init function returned error.
2023-01-19 14:56:01 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2023-01-19 14:56:01 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-01-19 14:56:01 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2023-01-19 14:56:01 0 [ERROR] Failed to initialize plugins.
2023-01-19 14:56:01 0 [ERROR] Aborting

还是没权限的问题,然后把/www/server/mysql也改成777,没权限问题解决,但仍然无法启动

2023-01-19 14:57:26 0 [Note] InnoDB: Using Linux native AIO
2023-01-19 14:57:26 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
2023-01-19 14:57:26 0 [Note] InnoDB: Uses event mutexes
2023-01-19 14:57:26 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
2023-01-19 14:57:26 0 [Note] InnoDB: Number of pools: 1
2023-01-19 14:57:26 0 [Note] InnoDB: Using SSE4.2 crc32 instructions
2023-01-19 14:57:26 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts)
2023-01-19 14:57:26 0 [Note] InnoDB: Initializing buffer pool, total size = 268435456, chunk size = 134217728
2023-01-19 14:57:26 0 [Note] InnoDB: Completed initialization of buffer pool
2023-01-19 14:57:26 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-01-19 14:57:26 0 [Note] InnoDB: Setting file './ibdata1' size to 12 MB. Physically writing the file full; Please wait ...
2023-01-19 14:57:26 0 [Note] InnoDB: File './ibdata1' size is now 12 MB.
2023-01-19 14:57:26 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 100663296 bytes
2023-01-19 14:57:26 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2023-01-19 14:57:26 0 [Note] InnoDB: New log file created, LSN=10314
2023-01-19 14:57:26 0 [Note] InnoDB: Doublewrite buffer not found: creating new
2023-01-19 14:57:26 0 [Note] InnoDB: Doublewrite buffer created
2023-01-19 14:57:26 0 [Note] InnoDB: 128 rollback segments are active.
2023-01-19 14:57:26 0 [Note] InnoDB: Creating foreign key constraint system tables.
2023-01-19 14:57:26 0 [Note] InnoDB: Creating tablespace and datafile system tables.
2023-01-19 14:57:26 0 [Note] InnoDB: Creating sys_virtual system tables.
2023-01-19 14:57:26 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-01-19 14:57:26 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-01-19 14:57:26 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2023-01-19 14:57:26 0 [Note] InnoDB: 10.5.6 started; log sequence number 0; transaction id 7
2023-01-19 14:57:26 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-01-19 14:57:26 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2023-01-19 14:57:26 0 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
2023-01-19 14:57:26 0 [Note] Server socket created on IP: '::'.
2023-01-19 14:57:26 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.db' doesn't exist
2023-01-19 14:57:26 0 [ERROR] Aborting

看了下日志中的记录,嗯?怎么是新创建数据库,我原来数据库呢?之前折腾半天mysql的配置文件给了我启发,去/etc/my.cnf中重新设置datadir和basedir的参数,问题解决,网站可以访问了。
结论:腾讯云轻量云wordpress镜像自身有问题,有参数没有设置好

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值