2015-09-18 11 views
6

うまくいけば誰かが私を助けてくれることを願っています。私はstackoverflowで回復の答えの多くを研究しました。mysqlfrmを使用して.frmファイルを回復する際の問題

データフォルダをmysqlからコピーし、新しいwamp 2.5 mysql/mysl5.6.17/dataフォルダに貼り付けたのは間違いでした。

テーブルをクリックすると「テーブルが存在しません」と表示されます。これは、以下の展示内容

3688 [警告] InnoDBテーブルを示しています開くことができませんテーブルcraigmedia /テーブルの.frmファイルが存在するがInnoDBの内部のデータ・ディクショナリからwp_eg_grids。問題の解決方法については、http://dev.mysql.com/doc/refman/5.6/en/innodb troubleshooting.htmlを参照してください。

.frmファイルを含むデータベースフォルダがあります。私はmysqlfrmに情報を入れたときの結果は以下のショーですがhttps://dba.stackexchange.com/questions/71596/restoring-mysql-tables-from-ibd-frm-and-mysqllogbin-files

1.mysqlfrm [email protected] --port=445 --user=root C:/wamp/bin/mysql/mysql5.6.17/data/craigmedia/wp_eg_grids.frm > wp_eg-grids.txt 


Source on localhost: ...connected 

ERROR: Cannot read wp_eg_grids.txt. You must have read privileges to the file or path and it must exist. Skipping this argument. 
ERROR: Cannot read .frm file from >.frm. 

私は、このリンクで説明したように、テーブルを回復するためにmysqlfrmを使用しようとしてきた

ユーティリティの実行: 'mysqlfrm --server = root @ localhost --port = 445 --user = root C:/wamp/bin/mysql/mysql5.6.17/data/craigmedia/wp_eg_grids.frm> wp_eg-grids.txt' がリターンコード '1'で終了しましたが、エラーメッセージが標準エラーにストリーミングされていませんでした。その実行結果を確認してください。

私はこれを試しました。

2. mysqlfrm [email protected]:3306 c:/wamp/bin/mysql/mysql5.6.17/data/craigmedia/wp_eg_grids.frm --port=3307 --user=root 

WARNING:コマンドラインインタフェースのパスワードを使用すると、安全でないことができます。私はwp_eg_grids.frmでテストする1 .FRMに、アクセスしてwp_eg_grids.txtにそれを作るためにしようとしている瞬間に

Source on localhost: ...connected. 
Spawning server with --user=root. 
Starting the spawned server on port 3307 ... 

The console has detected that the utility 'mysqlfrm' ended with an error code. You can get more information about the error by running the console command 'show last error'. 

Execution of utility: 'mysqlfrm [email protected]:3306 c:/wamp/bin/mysql/mysql5.6.17/data/craigmedia/wp_eg_grids.frm --port=3307 --user=root' ended with return code '1' and with the following error message: 
Traceback <most recent call last>: 

File "G:\ade\build\sb_0-16088143-1438774726.78\Python-2.7.6-windows-x86-64bit\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module> 
File "scripts\mysqlfrm.py", line 422, in <module> 
File ".\mysql\utilities\command\read_frm.py", line 439, in read_frm_files 
File ".\mysql\utilities\command\read_frm.py", line 166, in _spawn_server 
File ".\mysql\utilities\command\serverclone.py", line 180, in clone_server 
File ".\mysql\utilities\command\tools.py", line 254, in get_mysqld_version 

I0Error: [Errno 13] Permission denied: 'version_check' 

。誰かが私が間違っていることに気付くか、これを解決する方法を知っていますか?

+0

これで不運なことはありますか? – AlphaMale

+0

しばらく同じ問題を抱えています。運が良ければ? – pfinferno

+0

ねえ、運がなかった、私は私のウェブサイトをやり直す。 –

答えて

3

同様の状況で私のために働いていたmysqlfrmの構文を試してみてください。

mysqlfrm --server=root:[email protected]:3306 c:/wamp/bin/mysql/mysql5.6.17/data/craigmedia/wp_eg_grids.frm > c:/wamp/bin/mysql/mysql5.6.17/data/craigmedia/wp_eg_grids.txt --diagnostic --port=3307 -vvv --user=root 

Turn on diagnostic mode to read .frm files byte-by-byte and generate best-effort CREATE statement.

+0

adminとして実行するようにしてください – tsukimi

0

あなたの問題は私に類似していてもよい:MySQLは、サーバが起動しない生み出しました。

問題はMySQLの一時的なdatadirから始まります。デフォルトでは現在のディレクトリです。このディレクトリには、適切な権限を持つ新しい一時ディレクトリ(62a77962-9a4b-49d0-b91a-a5e9eb71b894のようなもの)があります。

  • Linuxの場合:rootとして実行する場合(mysqlfrmを実行しているユーザーではなく、ユーザーにあなたが反対のMySQLを起動する)、あなたはおそらくmysqlシステムユーザが読むことができない、/root/ディレクトリにある(でも、mysqlの場合ユーザーはrootです)。
  • Windows:同じ問題管理者として実行すると、MySQLユーザーが現在のディレクトリを読み取る権限を持っていない可能性があります。

ソリューションは、Windows上で(このworld readableディレクトリに関連付けられているすべてのセキュリティ上の問題で)Linux上/tmp/、または多分C:\として、MySQLの読み込み可能なディレクトリに(cdを使用して)を移動することです。

私はMySQLのログ(Linuxの:/var/log/mysql/mysql.log)を見て、それを見つけた:だった

/usr/sbin/mysqld: Can't change dir to '/root/aa9fe487-0c77-4bb4-a829-036fc9919558/' (Errcode: 13 - Permission denied)

Startコマンドを:述べ/tmp/に移動

/usr/sbin/mysqld --no-defaults --basedir=/usr --datadir=/root/aa9fe487-0c77-4bb4-a829-036fc9919558 --pid-file=/root/aa9fe487-0c77-4bb4-a829-036fc9919558/clone.pid --port=3310 --server-id=101 --socket=/root/aa9fe487-0c77-4bb4-a829-036fc9919558/mysql.sock --tmpdir=/root/aa9fe487-0c77-4bb4-a829-036fc9919558 --user=mysql

は、問題を修正し、 mysqlfrmは期待どおりに機能しました。

利用できる場合、私はtmpdirオプションを使用していただろうが、read_frm.pyに述べたように、それは、ありません:

# Since Python libraries correctly restrict temporary folders to 
# the user who runs the script and /tmp is protected on some 
# platforms, we must create the folder in the current folder 
    temp_datadir = os.path.join(os.getcwd(), str(uuid.uuid4())) 
    os.mkdir(temp_datadir) 

とMySQLは本当の家を持っている...かあなたはありません/var/lib/mysql/ディレクトリを台無しにしたくないかもしれません!

関連する問題