数据目录更改后 Percona 服务器不会重新启动

数据目录更改后 Percona 服务器不会重新启动

我在具有固态硬盘的 ubuntu 12.04 服务器上从 percona 存储库安装了 percona。我想我宁愿将数据目录放在固态硬盘上,并将分区放在普通 SATA 驱动器上。下面是我的设置,本质上是 my-large.cnf 的副本,我向其中添加了数据目录和日志文件,以便查看服务器启动失败的原因:

[mysqld]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock
datadir         = /mnt/disk2/mysqldata
general-log-file= /var/log/mysql.log
log-error       = /var/log/mysql-error.log
skip-external-locking

启用日志后我看到:

130127 11:49:07 mysqld_safe mysqld from pid file /mnt/disk2/mysqldata/servername.pid ended
130127 12:07:55 mysqld_safe Starting mysqld daemon with databases from /mnt/disk2/mysqldata
130127 12:07:55 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
130127 12:07:55 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130127 12:07:55 InnoDB: The InnoDB memory heap is disabled
130127 12:07:55 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130127 12:07:55 InnoDB: Compressed tables use zlib 1.2.3
130127 12:07:55 InnoDB: Using Linux native AIO
130127 12:07:55 InnoDB: Initializing buffer pool, size = 128.0M
130127 12:07:55 InnoDB: Completed initialization of buffer pool
130127 12:07:55 InnoDB: highest supported file format is Barracuda.
130127 12:07:55  InnoDB: Waiting for the background threads to start
130127 12:07:56 Percona XtraDB (http://www.percona.com) 1.1.8-rel29.3 started; log   sequence number 1597945
130127 12:07:56 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130127 12:07:56 [Note]   - '0.0.0.0' resolves to '0.0.0.0';
130127 12:07:56 [Note] Server socket created on IP: '0.0.0.0'.
130127 12:07:56 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
130127 12:07:56 mysqld_safe mysqld from pid file /mnt/disk2/mysqldata/servername.pid ended
130127 12:08:50 mysqld_safe Starting mysqld daemon with databases from /mnt/disk2/mysqldata
/usr/sbin/mysqld: File './mysql-bin.~rec~' not found (Errcode: 13)
130127 12:08:50 [ERROR] MYSQL_BIN_LOG::open_purge_index_file failed to open register  file.
130127 12:08:50 [ERROR] MYSQL_BIN_LOG::open_index_file failed to sync the index file.
130127 12:08:50 [ERROR] Aborting

130127 12:08:50 [Note] /usr/sbin/mysqld: Shutdown complete

130127 12:23:41 [Note] /usr/sbin/mysqld: Shutdown complete

130127 12:23:41 mysqld_safe mysqld from pid file /mnt/disk2/mysqldata/servername.pid ended
130127 18:06:57 mysqld_safe Starting mysqld daemon with databases from /mnt/disk2/mysqldata
130127 18:06:57 [Warning] The syntax '--log' is deprecated and will be removed in a future release. Please use '--general-log'/'--general-log-file' instead.
/usr/sbin/mysqld: File './mysql-bin.~rec~' not found (Errcode: 13)
130127 18:06:57 [ERROR] MYSQL_BIN_LOG::open_purge_index_file failed to open register  file.
130127 18:06:57 [ERROR] MYSQL_BIN_LOG::open_index_file failed to sync the index file.
130127 18:06:57 [ERROR] Aborting

我以为是权限问题或者我应该将数据复制/var/lib/mysql到新文件夹,但现在我可以生成日志,但我不确定该怎么做。

感谢您的帮助

答案1

没关系,我将文件从 /var/lib/mysql 复制到了新位置。

相关内容