English 中文(简体)
MySQL 致命错误: • 开放和锁定特权表: 更正文档格式用户
原标题:MySQL Fatal error: Can t open and lock privilege tables: Incorrect file format user

MySQL(Percona 5.6)将不开始。

我曾多次发生这一错误。 我每次都不得不拆除MySQL的数据目录,并重新安装MySQL。

是否有另一种办法解决MySQL? (具体地说,数据没有被冲走?)

/var/log/mysql/error.log

150214 16:36:39 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2015-02-14 16:36:40 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2015-02-14 16:36:40 0 [Warning]  THREAD_CONCURRENCY  is deprecated and will be removed in a future release.
2015-02-14 16:36:40 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-02-14 16:36:40 1018 [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.
2015-02-14 16:36:40 1018 [Note] Plugin  FEDERATED  is disabled.
/usr/sbin/mysqld: Incorrect file format  plugin 
2015-02-14 16:36:40 1018 [ERROR] Can t open the mysql.plugin table. Please run mysql_upgrade to create it.
2015-02-14 16:36:40 1018 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-02-14 16:36:40 1018 [Note] InnoDB: The InnoDB memory heap is disabled
2015-02-14 16:36:40 1018 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-02-14 16:36:40 1018 [Note] InnoDB: Memory barrier is not used
2015-02-14 16:36:40 1018 [Note] InnoDB: Compressed tables use zlib 1.2.8
2015-02-14 16:36:40 1018 [Note] InnoDB: Using Linux native AIO
2015-02-14 16:36:40 1018 [Note] InnoDB: Using CPU crc32 instructions
2015-02-14 16:36:40 1018 [Note] InnoDB: Initializing buffer pool, size = 256.0M
2015-02-14 16:36:40 1018 [Note] InnoDB: Completed initialization of buffer pool
2015-02-14 16:36:40 1018 [Note] InnoDB: Highest supported file format is Barracuda.
2015-02-14 16:36:40 1018 [Note] InnoDB: The log sequence numbers 714340126 and 714340126 in ibdata files do not match the log sequence number 716513090 in the ib_logfiles!
2015-02-14 16:36:40 1018 [Note] InnoDB: Database was not shutdown normally!
2015-02-14 16:36:40 1018 [Note] InnoDB: Starting crash recovery.
2015-02-14 16:36:40 1018 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-02-14 16:36:40 1018 [Note] InnoDB: Restoring possible half-written data pages 
2015-02-14 16:36:40 1018 [Note] InnoDB: from the doublewrite buffer...
InnoDB: Last MySQL binlog file position 0 292596, file name binlog.000056
2015-02-14 16:36:40 1018 [Note] InnoDB: 128 rollback segment(s) are active.
2015-02-14 16:36:40 1018 [Note] InnoDB: Waiting for purge to start
2015-02-14 16:36:40 1018 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.21-70.1 started; log sequence number 716513090
2015-02-14 16:36:40 1018 [Note] Recovering after a crash using binlog
2015-02-14 16:36:40 1018 [Note] Starting crash recovery...
2015-02-14 16:36:40 1018 [Note] Crash recovery finished.
2015-02-14 16:36:40 1018 [Note] RSA private key file not found: /var/lib/mysql//private_key.pem. Some authentication plugins will not work.
2015-02-14 16:36:40 1018 [Note] RSA public key file not found: /var/lib/mysql//public_key.pem. Some authentication plugins will not work.
2015-02-14 16:36:40 1018 [Note] Server hostname (bind-address):  * ; port: 3306
2015-02-14 16:36:40 1018 [Note] IPv6 is available.
2015-02-14 16:36:40 1018 [Note]   -  ::  resolves to  :: ;
2015-02-14 16:36:40 1018 [Note] Server socket created on IP:  :: .
2015-02-14 16:36:40 1018 [ERROR] Fatal error: Can t open and lock privilege tables: Incorrect file format  user 
150214 16:36:40 mysqld_safe mysqld from pid file /tmp/mysqld.pid ended
最佳回答

由于约翰把我放在正确的轨道上,我有几条其他hoo子可以跳到我的系统。 希望有助于人们。

这是一个腐败的特权表。 可能是升级或电力故障所致。 我的系统是开放式的。 简单地重新插入并不固定,必须删除MySQL的所有痕迹,然后重新加入。

关闭MySQL的所有事件

$ systemctl stop mysql.service
$ pkill -9 mysqld

起始服务器绕过特权系统

$ sudo mysqld_safe --user=root --skip-grant-tables

启动MySQL指挥线工具

$ mysql

收到

ERROR 2002 (HY000): Can t connect to local MySQL server through socket  /var/run/mysqld/mysqld.sock  (2)

我的原木——安全正在别处。 予以赔偿。

$ sudo find / -type s

Mine was in /var/run/mysql/ Edit the socket line in my.cnf, making a note of your existing socket setting. My line became

socket=/var/run/mysql/mysql.sock

Return to 关闭MySQL的所有事件 (the top of these instructions). Follow them through to 启动MySQL指挥线工具 . Hopefully you can open mysql successfully. From mysql command line.

mysql> use mysql
mysql> repair table user use_frm;
mysql> exit

关闭MySQL的所有事件

$ systemctl stop mysql.service
$ pkill -9 mysqld

重新接手我的笔记,将记票线退回到原来的位置。

我不得不在我的神话数据目录中重新获得2份档案许可。

$ chown mysql:mysql server2.err
$ chown mysql:mysql server2.pid

启用MySQL服务器

$ systemctl start mysql.service

然后,我用另一个表格(db)得出同样的原始错误。

[ERROR] Fatal error: Can t open and lock privilege  tables: Incorrect file format  db 

在确定所有特权表之前,必须重复上述程序多次改变修理指挥。

mysql> repair table db use_frm;
问题回答

页: 1 www.un.org/Depts/DGACM/index_french.htm

首先,从<条形码>mysql-container开始使用一个新的cker集装箱。 (同一位你曾与亚洲开发银行写过。)

$ docker run --rm -it -v <named_volume>:/var/lib/mysql mysql:<tag> /bin/bash

This will launch a new container with the correct named volume (or mounted volume) mounted in the container and drop you into a shell as root. The mysqld-Daemon will refuse to launch as root though, so we ll run it as the mysql-user:

$ whoami
root
$ which mysqld
/usr/sbin/mysqld
$ su mysql
$ whoami
mysql
$ /usr/sbin/mysqld --skip-grant-tables
....

我们现在要管理这辆车,我们把车从一个新的终点站连接起来。

$ docker ps 
CONTAINER ID [...]
abc123 [...]
$ docker exec -it abc123 /bin/bash
# We re on the container now!
$ whoami
root
$ mysql
...

And continue from there. When you re done, leave the container on the second terminal via exit. The terminal running mysqld will not respond to CMD+C, so we ll stop the container via Docker:

$ docker ps
CONTAINER ID [...]
abc123 [...]
$ docker stop abc123




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签