我刚刚在Ubuntu16.04上安装了MariaDB10.1.16,但是由于空间不足,默认的数据目录不合适,我需要将它移到另一个卷。我已经将datadir条目添加到我的mysql.cnf文件中,但是当我尝试加载mysql服务时,我得到了以下结果:
ago 12 08:27:40 aristotle mysqld[13786]: 2016-08-12 8:27:40 140584295778560 [Note] Plugin 'FEEDBACK' is disabled.
ago 12 08:27:40 aristotle mysqld[13786]: 2016-08-12 8:27:40 140583574173440 [Note] InnoDB: Dumping buffer pool(s) not yet started
ago 12 08:27:40 aristotle mysqld[13786]: 2016-08-12 8:27:40 140584295778560 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
ago 12 08:27:40 aristotle mysqld[13786]: 2016-08-12 8:27:40 140584295778560 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
ago 12 08:27:40 aristotle mysqld[13786]: 2016-08-12 8:27:40 140584295778560 [Note] Server socket created on IP: '::'.
ago 12 08:27:40 aristotle mysqld[13786]: 2016-08-12 8:27:40 140584295778560 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't
ago 12 08:27:40 aristotle systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
ago 12 08:27:40 aristotle systemd[1]: Failed to start MariaDB database server.
ago 12 08:27:40 aristotle systemd[1]: mariadb.service: Unit entered failed state.
ago 12 08:27:40 aristotle systemd[1]: mariadb.service: Failed with result 'exit-code'.我的配置文件是:
[client]
# Default is Latin1, if you need UTF-8 set this (also in server section)
default-character-set = utf8
[mysqld]
#
# * Character sets
#
# Default is Latin1, if you need UTF-8 set all this (also in client section)
#
character-set-server = utf8
collation-server = utf8_general_ci
character_set_server = utf8
collation_server = utf8_general_ci
datadir = /BulkData/Mariadb 我需要做什么才能使我的数据库在不同的卷上?
发布于 2016-08-16 13:50:29
在这种情况下,您有两个选项,增加分区大小(root),或者复制到另一个目录并创建一个symbolic link。第一种选择似乎更自然,但是,如果你做错了什么,这可能会损害你的整个系统。第二个是我的选择,因为它不涉及太多的风险,而且更容易。如果您真的想使用第一个链接,可以检查以下链接:http://www.hiroom2.com/2016/05/19/ubuntu-16-04-extend-and-reduce-lvm-root-filesystem/
如果您想使用第二种选择,只需:
df -hservice mysql stopmv /var/lib/mysql /usr/lib/mysqlln -s /usr/lib/mysql /var/lib/mysqlservice mysql starthttps://stackoverflow.com/questions/38923946
复制相似问题