私はfedora9(それ以上起動しなかった古いドライブ)からubuntu 16.04サーバにmysqlデータベースを移行しようとしています。古いハードドライブシステムからのmysql datadirは起動しません
新しいシステムの古いシステムの/ var/lib/mysqlフォルダを/ testdb/mysqlにコピーしました。
私は所有者をmysql:mysqlに変更して新しいフォルダに入れ、my.confのdatadirをこの新しいフォルダに更新しますが、mysqlサーバはもう起動しません。私は次のエラーを取得する:
170625 12:44:37 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
170625 12:44:37 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
170625 12:44:37 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
170625 12:44:37 InnoDB: The InnoDB memory heap is disabled
170625 12:44:37 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170625 12:44:37 InnoDB: Compressed tables use zlib 1.2.8
170625 12:44:37 InnoDB: Using Linux native AIO
170625 12:44:37 InnoDB: Initializing buffer pool, size = 128.0M
170625 12:44:37 InnoDB: Completed initialization of buffer pool
170625 12:44:37 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
170625 12:44:38 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
170625 12:44:38 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
170625 12:44:38 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
170625 12:44:38 InnoDB: The InnoDB memory heap is disabled
170625 12:44:38 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170625 12:44:38 InnoDB: Compressed tables use zlib 1.2.8
170625 12:44:38 InnoDB: Using Linux native AIO
170625 12:44:38 InnoDB: Initializing buffer pool, size = 128.0M
170625 12:44:38 InnoDB: Completed initialization of buffer pool
170625 12:44:38 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
170625 12:44:38 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
170625 12:44:38 [Note] Plugin 'FEDERATED' is disabled.
/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
170625 12:44:38 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
170625 12:44:38 InnoDB: The InnoDB memory heap is disabled
170625 12:44:38 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170625 12:44:38 InnoDB: Compressed tables use zlib 1.2.8
170625 12:44:38 InnoDB: Using Linux native AIO
170625 12:44:38 InnoDB: Initializing buffer pool, size = 128.0M
170625 12:44:38 InnoDB: Completed initialization of buffer pool
170625 12:44:38 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
私は(だけでそれを試して)でも777すべてのファイルに、すべての権限を変更しようとしましたが、常に同じ結果を持っています。
どのようにデータベースを回復できますか?
正常に動作します所有者をmysql:mysql(sudo chown -R mysql:mysql/testdb/mysql)に変更しました。この最初の変更がうまくいかないので、私はすべての権限を777に変更しようとしました。(ユーザとグループとしてmysqlを保存しています) – togarha
ibdataファイルのユーザとアクセス権:-rwxrwxrwx 1 mysql mysql 18874368 jun 25 12:22 ibdata1' – togarha
新しいテスト'/ var/lib/mysql'のテスト用データベースを使ってデフォルトのフォルダをうまく動作させてから' sudo mkdir/var/liv'という名前のユーザとグループを持つ 'root:root'を作成しました。 'sudo cp -rp/var/lib/mysql/var/liv'ディレクトリにmysqlをコピーして、新しいディレクトリにコピーしました。/etc/mysql/my.cnfから 'datadir =/var/liv/mysql'にcnfするとmysqlはもう起動しませんでした(その後、フォルダが正しく変更されていると思いますが、何かが失敗します) – togarha