MariaDB启动时出错(并不是说有错误)
$ sudo service mysql start
* Starting MariaDB database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
腐败和威胁我们的maria女士。
$ mysql_upgrade -u panel -p
(略)
Could not create the upgrade info file '/var/lib/mysql/mysql_upgrade_info' in the MySQL Servers datadir, errno: 13
然而,当执行mysql_upgrade进行升级时,会出现上述错误。
$ apt-cache policy mariadb-server
Installed: 5.5.57-1ubuntu0.14.04.1
Candidate: 5.5.58-1ubuntu0.14.04.1
Version table:
5.5.58-1ubuntu0.14.04.1 0
500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages
*** 5.5.57-1ubuntu0.14.04.1 0
100 /var/lib/dpkg/status
5.5.36-1 0
500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
好像有最新版本的样子。
$ sudo apt-get update
(略)
mariadb-client-5.5 mariadb-client-core-5.5 mariadb-common mariadb-server
mariadb-server-5.5 mariadb-server-core-5.5 multiarch-support mysql-common
(略)
$ sudo apt-get upgrade
由于还有其他各种更新内容,所以一起更新了。
$ mysql_upgrade -u username -p
(略)
Could not create the upgrade info file '/var/lib/mysql/mysql_upgrade_info' in the MySQL Servers datadir, errno: 13
然而,最终还是出现了错误。错误代码13是什么原因呢?
#define EACCES 13 /* Permission denied */
以下是来自Qiita文章”搜索errno的值的定义”。听说是与权限有关,所以尝试使用sudo。
$ sudo mysql_upgrade -u panel -p
This installation of MySQL is already upgraded to 5.5.58-MariaDB, use --force if you still need to run mysql_upgrade
看起来需要使用–force选项。
$ sudo mysql_upgrade -u panel -p --force
(略)
OK
因为收到“OK”,所以尝试重新启动MariaDB。
$ sudo service mysql restart
* Stopping MariaDB database server mysqld [ OK ]
* Starting MariaDB database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
……到底是什么可以接受的呢……顺便说一下,好像这条消息没问题……。
根据1、2、3进行参考。