我有一个EC2实例,并试图将mysql数据目录从默认驱动器移动到另一个EBS卷。 我将/var/lib/mysql的mysql目录移动到了新目标,然后修改了my.cnf文件以将数据目录指向新的位置。 然后我试图重新启动MySQL我收到以下消息。
MySQL Daemon failed to start. Starting mysqld: [FAILED]
我正在运行一个新的EC2实例附带的Linux的默认分配。 以下是my.cnf文件和mysqld.log详细信息。 有什么我可能做错的build议?
my.cnf中
[mysqld] #datadir=/var/lib/mysql datadir=/root/appfinder/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
设置文件夹的权限
chmod -R 777 /root/appfinder/mysql
mysqld.log
110616 18:37:53 mysqld_safe Starting mysqld daemon with databases from /root/appfinder/mysql /usr/libexec/mysqld: Table 'plugin' is read only 110616 18:37:53 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. InnoDB: Log scan progressed past the checkpoint lsn 0 37356 110616 18:37:53 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the .ibd files... InnoDB: Restoring possible half-written data pages from the doublewrite InnoDB: buffer... InnoDB: Doing recovery: scanned up to log sequence number 0 44233 110616 18:37:53 InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percents: 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66$ InnoDB: Apply batch completed 110616 18:37:53 InnoDB: Started; log sequence number 0 44233 5110616 18:37:53 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'host' is read only 110616 18:37:53 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
我试图将我的EBS卷重新安装到/myFolder而不是/root/myFolder 。 这似乎纠正了权限问题。
/ root / appfinder / mysql主pipe必须是拥有者mysql。 为此,chown mysql:mysql / root / appfinder / mysql和chown -R mysql:mysql / root / appfinder / mysql /。
所有数据文件的MySQL必须是所有者的MySQL。
我有类似的问题。
以下是我在Ubuntu 12.04 Lts上运行的步骤:
想要将数据文件从/ var / lib / mysql移动到/ newdir_path / newdir
input: