mysql:作业无法启动。 mysqld.sock丢失

我怎样才能解决这个问题,并启动MySQL服务器?

/etc/init.d/mysql启动或服务mysql启动后,我得到的消息开始:“作业启动失败”#mysqld后,我得到这个:

mysqld 121123 11:33:33 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys' 121123 11:33:33 [Note] Plugin 'FEDERATED' is disabled. mysqld: Unknown error 1146 121123 11:33:33 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 121123 11:33:33 InnoDB: The InnoDB memory heap is disabled 121123 11:33:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins 121123 11:33:33 InnoDB: Compressed tables use zlib 1.2.3.4 121123 11:33:33 InnoDB: Initializing buffer pool, size = 128.0M 121123 11:33:33 InnoDB: Completed initialization of buffer pool 121123 11:33:33 InnoDB: highest supported file format is Barracuda. 121123 11:33:33 InnoDB: Waiting for the background threads to start 121123 11:33:34 InnoDB: 1.1.8 started; log sequence number 1595675 121123 11:33:34 [ERROR] Aborting 121123 11:33:34 InnoDB: Starting shutdown... 121123 11:33:35 InnoDB: Shutdown completed; log sequence number 1595675 121123 11:33:35 [Note] 

我尝试做什么MySQL说我做:

 mysql_upgrade Looking for 'mysql' as: mysql Looking for 'mysqlcheck' as: mysqlcheck Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect FATAL ERROR: Upgrade failed 

是的,/ var / run / mysql是空的:

 mysql_upgrade Looking for 'mysql' as: mysql Looking for 'mysqlcheck' as: mysqlcheck Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect FATAL ERROR: Upgrade failed 

这是我的文件/etc/mysql/my.cnf

 # cat /etc/mysql/my.cnf |grep sock # Remember to edit /etc/mysql/debian.cnf when changing the socket location. socket = /var/run/mysqld/mysqld.sock socket = /var/run/mysqld/mysqld.sock socket = /var/run/mysqld/mysqld.sock 

然后我尝试从cero重新安装mysql:

  apt-get purge mysql-client mysql-common mysql-server rm -R /var/lib/mysql rm -R /etc/mysql rm -R /var/run/mysqld userdel mysql apt-get install mysql-server mysql-client 

然后,input我的root密码为mysql后,我得到这个错误:

  | Unable to set password for the MySQL "root" user │ │ │ │ An error occurred while setting the password for the MySQL administrative │ │ user. This may have happened because the account already has a password, or │ │ because of a communication problem with the MySQL server. │ │ │ │ You should check the account's password after the package installation. │ │ │ │ Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more │ │ information. 

再次,我无法启动mysql获取相同的消息。

也许你正在运行MySQL的循环依赖,无法启动和运行Debianconfiguration脚本,试图解决这个问题,需要运行MySQL。

尝试使用mysql_install_db重新初始化您的数据目录“脱机”。

首先,你的my.cnf中不应该有3个套接字文件

尝试以下方法:

dpkg-reconfigure mysql-server

您将被要求(提供)为root用户设置密码。 祝你好运