Closed Tndot closed 3 months ago
发现数据库的halo消失了,这要怎么恢复
关键日志:
Unknown database 'halo'
这似乎是初始化 MySQL 容器的时候没有按照 MYSQL_DATABASE
变量正常创建 halo 数据库,建议观察一下 MySQL 容器的日志。此外,如果当前你是第一次安装,数据库还没有内容,我建议删掉 mysql 挂载的数据目录,然后重试。
关键日志:
Unknown database 'halo'
这似乎是初始化 MySQL 容器的时候没有按照 变量正常创建 halo 数据库,建议观察一下 MySQL 容器的日志。此外,如果当前你是第一次安装,数据库还没有内容,我建议删掉 mysql 挂载的数据目录,然后重试。
MYSQL_DATABASE
MySQL 容器的日志指的是docker logs halo_halodb_1吗?这并不是我第一次安装,数据库之前是有内容的,服务器重启后,出现的问题。
以下是halo_halodb_1容器日志
2024-04-28 13:37:56+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.1.0-1.el8 started.
2024-04-28 13:37:56+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
2024-04-28 13:37:56+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.1.0-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-04-28T13:37:57.113034Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-04-28T13:37:57.387166Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_c ache_size=0 instead.
2024-04-28T13:37:57.389212Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.1.0) starting as process 1
2024-04-28T13:37:57.396923Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-04-28T13:37:57.708183Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-04-28T13:37:57.967317Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-04-28T13:37:57.967346Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-04-28T13:37:57.969506Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consi der choosing a different directory.
2024-04-28T13:37:57.993479Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.1.0' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
2024-04-28T13:37:57.993558Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2024-04-28T14:11:12.569104Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user
系统信息
使用的哪种方式运行?
Docker
发生了什么?
服务器重启后,docker重启一直失败,使用
docker-compose restart
指令重启相关日志输出
附加信息
No response