由于时区的原因,在mariadb服务器上apt-get升级总是失败



MariaDB 10.1.3,内核3.19.3,Debian

问题:由于mariadb服务器时区问题,apt-get升级总是失败。

my.cnf包含

[mysqld]
default_time_zone=America/New_York

我还导入了tzinfo:

# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql

当我手动停止/启动服务时,没有问题:

# service mysql restart
[ ok ] Stopping MariaDB database server: mysqld.
[ ok ] Starting MariaDB database server: mysqld ..
[info] Checking for corrupt, not cleanly closed and upgrade needing tables..

然而,每次我运行apt-get升级时,它总是在mariadb服务器上失败:

# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]?
Setting up mariadb-server-10.1 (10.1.3+maria-1~wheezy) ...
[ ok ] Stopping MariaDB database server: mysqld.
dpkg: error processing mariadb-server-10.1 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
mariadb-server depends on mariadb-server-10.1 (= 10.1.3+maria-1~wheezy); however:
Package mariadb-server-10.1 is not configured yet.
dpkg: error processing mariadb-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mariadb-server-10.1
mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

错误为:

# tail /var/log/syslog
mysqld_safe[32269]: [ERROR] Fatal error: Illegal or unknown default time zone 'America/New_York'

这种情况发生在多台服务器上,已经成为一种真正的烦恼。可能需要你的帮助。顺便说一句,它不是MariaDB版本,因为这个错误在几个版本中已经持续了几年。

编辑添加:我忘了提到,如果我从my.cnf中删除default_time_zone参数,apt-get升级确实有效。只有当该参数存在时,apt-get升级才会失败。它需要存在于我的配置中。

编辑2:为了确保清晰性,即使在删除default_time_zone,然后成功执行apt-get升级,然后添加回default_time_ zone并重新启动——未来的mariadb-*升级将通过apt失败。apt-get更新过程中有一些特定的过程与正常服务启动不一致。

也有同样的问题。这就是对我有效的:

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/lib/mysql
sudo apt-get install mariadb-server

备份/var/lib/mysql文件夹,因为中的所有数据都将被删除

也许答案是"MySQL安装过程在MySQL数据库中创建时区表,但不加载它们。您必须使用以下说明手动完成…">

请参阅手册页面。

您也可以选择提交有关安装错误的错误报告。

相关内容

  • 没有找到相关文章

最新更新