UBUNTU:MySQL数据库消失 – 重新启动服务后返回

今晚我的MySQL数据库消失了。 我正在谈论SHOW DATABASES; 只返回“默认”数据库(information_shema,mysql和dbispconfig [我的configuration面板])。

我看了/var/data/mysql ,所有的数据还在那里。 所以,备份后,我做了一个service mysql restart ,一切正常。

那么,为什么会发生呢? cat syslog.1 | grep mysql cat syslog.1 | grep mysql显示

 Jun 15 00:03:30 ns222201 named[3699]: built with '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc/bind' '--localstatedir=/var' '--enable-threads' '--enable-largefile' '--with-libtool' '--enable-shared' '--enable-static' '--with-openssl=/usr' '--with-gssapi=/usr' '--with-gnu-ld' '--with-dlz-postgres=no' '--with-dlz-mysql=no' '--with-dlz-bdb=yes' '--with-dlz-filesystem=yes' '--with-dlz-ldap=yes' '--with-dlz-stub=yes' '--with-geoip=/usr' '--enable-ipv6' 'CFLAGS=-fno-strict-aliasing -DDIG_SIGCHASE -O2' 'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS=' Jun 15 00:03:31 ns222201 /etc/mysql/debian-start[3732]: Upgrading MySQL tables if necessary. Jun 15 00:03:31 ns222201 /etc/mysql/debian-start[3735]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored Jun 15 00:03:31 ns222201 /etc/mysql/debian-start[3735]: Looking for 'mysql' as: /usr/bin/mysql Jun 15 00:03:31 ns222201 /etc/mysql/debian-start[3735]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck Jun 15 00:03:31 ns222201 /etc/mysql/debian-start[3735]: Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' '--host=localhost' '--socket=/var/run/mysqld/mysqld.sock' '--host=localhost' '--socket=/var/run/mysqld/mysqld.sock' Jun 15 00:03:31 ns222201 /etc/mysql/debian-start[3735]: Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' '--host=localhost' '--socket=/var/run/mysqld/mysqld.sock' '--host=localhost' '--socket=/var/run/mysqld/mysqld.sock' ... [restarting with the wrong tables] 

我在那台机器上得到了大约15个数据驱动的网站,我不希望这样的事情再次发生。

任何想法如何进一步调查?

似乎你已经升级你的MySQL。

数据库服务器升级时,通常运行mysql_upgrade。 它检查表的一致性,修复,然后升级数据库。

大多数旧的表都很好,但是有时你需要运行升级命令。 我只有几次这个问题的具体升级。

也许你已经升级了mysql的二进制文件和库,mysql进程还没有重启,并且是以旧版本的方式工作,那么你已经重启了进程,并开始工作,所以db升级是必需的。

也许这是如何Ubuntu的MySQL的工作原理。 RHEL / Centos / Fedora在软件包更新时升级表并重新加载进程。