私はMySQL 5.7とCentOS 7.2を使用しています。MySQL 5.7変更データディレクトリ
まず、my.cnfファイルの私のDATADIR構成は/ var/libに/ mysqlの
今、私はDATADIR変更したいです。
私は二つの方法を試してみてくださいHAVA:
まず、私は/ホーム/データへの/ var/libに/ mysqlの中ですべてのファイルとディレクトリをコピーし、chown -R mysql:mysql /home/data
を実行します。私はは/ var/libに/ MySQLへ/ホーム移動と/ var/libディレクトリにln -s /home/mysql mysql
を実行し、
2016-12-08T16:33:38.206780Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2016-12-08T16:33:38.206806Z 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2016-12-08T16:33:38.206817Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2016-12-08T16:33:38.807398Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2016-12-08T16:33:38.807421Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-12-08T16:33:38.807429Z 0 [ERROR] Failed to initialize plugins.
2016-12-08T16:33:38.807436Z 0 [ERROR] Aborting
第二:私はsystemctl start mysqld
を実行したときしかし、私は、エラーメッセージが表示されます。 systemctl start mysqld
を実行すると、エラーメッセージが表示されます。
2016-12-08T16:48:28.958136Z 0 [ERROR] InnoDB: Operating system error number 13 in a file operation.
2016-12-08T16:48:28.958165Z 0 [ERROR] InnoDB: The error means mysqld does not have the access rights to the directory.
2016-12-08T16:48:28.958174Z 0 [ERROR] InnoDB: os_file_get_status() failed on './ibdata1'. Can't determine file permissions
2016-12-08T16:48:28.958184Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2016-12-08T16:48:29.558751Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2016-12-08T16:48:29.558792Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-12-08T16:48:29.558806Z 0 [ERROR] Failed to initialize plugins.
2016-12-08T16:48:29.558817Z 0 [ERROR] Aborting
どうすれば対処できますか?
私はこの問題をWindowsで持っていました。ログファイルを削除すると、サービスは正常に開始されました。あなたがバックアップを削除して、再度サービスを開始しようとすると、ibdata1がログファイルになります。 – Rajesh
@Rajeshすべての 'ib_logfile'を削除しようとしました。しかし、それは動作しません。どうもありがとう。 – lbear
ここをクリックして問題を解決できますか? –