我在我的系统上安装了Ubuntu14.04。我最近更新了ubuntu,现在我的mysql没有启动,工作台说mysql服务器已经停止。当我尝试启动时,它会给出以下错误
2014-08-12 23:02:04 - Checking server status...
2014-08-12 23:02:04 - Trying to connect to MySQL...
2014-08-12 23:02:04 - Can't connect to MySQL server on '127.0.0.1' (111) (2003)
2014-08-12 23:02:04 - Assuming server is not running
2014-08-12 23:02:04 - Server start done.
2014-08-12 23:02:04 - Checking server status...
2014-08-12 23:02:04 - Trying to connect to MySQL...
2014-08-12 23:02:04 - Can't connect to MySQL server on '127.0.0.1' (111) (2003)
2014-08-12 23:02:04 - Assuming server is not running此外,当我尝试使用终端(mysql -u root -p <password>)登录时,我会得到以下错误:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)我也尝试重新安装Ubuntu,但我无法这样做。给出以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server-5.5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.由于无法登录到服务器,所以我没有备份数据。我是新手,请帮我解决这个问题,不要丢失我的资料。
等待你最早的回应。
下面是cat /var/log/mysql/error.log中的错误消息
140813 21:22:50 [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.
140813 21:22:50 [Note] Plugin 'FEDERATED' is disabled.
140813 21:22:50 InnoDB: The InnoDB memory heap is disabled
140813 21:22:50 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140813 21:22:50 InnoDB: Compressed tables use zlib 1.2.8
140813 21:22:50 InnoDB: Using Linux native AIO
140813 21:22:50 InnoDB: Initializing buffer pool, size = 128.0M
140813 21:22:50 InnoDB: Completed initialization of buffer pool
140813 21:22:50 InnoDB: highest supported file format is Barracuda.
140813 21:22:50 InnoDB: Waiting for the background threads to start
140813 21:22:51 InnoDB: 5.5.38 started; log sequence number 80726593570
140813 21:22:51 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
140813 21:22:51 [Note] - '127.0.0.1' resolves to '127.0.0.1';
140813 21:22:51 [Note] Server socket created on IP: '127.0.0.1'.
140813 21:22:51 [ERROR] Fatal error: Can't open and lock privilege tables: Incorrect file format 'user'发布于 2014-08-21 10:17:14
我要感谢塞勒姆,他帮助我为我的问题提出了各种解决办法。
我无法用这些建议来解决我的问题。因为我有非常重要的数据,所以我不想丢失数据。
以下是我最终所做的
/var/lib/mysql副本,这帮助我重新获得所有表和内部数据,而不必再次导入数据。要获得访问mysql中的文件和文件夹的权限,请运行以下命令:
sudo chmod 777 /var/lib/mysql要获得访问mysql文件夹中文件的权限,请运行以下命令:
sudo chmod 777 /var/lib/mysql/*我不得不分别删除mysql 5.5,即使我使用了autoremove和autoclean,因为当我设置根密码时,它会给我一个错误,因为它说它无法创建根用户。
/var/lib/mysql文件夹。确保不替换新安装中的基本文件。因为这再次造成同样的问题,服务器再次停止运行。
https://askubuntu.com/questions/510415
复制相似问题