Starting MySQL. ERROR!

本文记录了一次解决MySQL服务器启动失败及本地连接问题的经历,包括配置错误导致的服务无法启动和远程连接失败,最终通过调整配置文件恢复服务,并成功创建远程用户实现连接。

Question:

Starting MySQL. ERROR! The server quit without updating PID file

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38)

 

这是我的MySQL配置,本来因为要远程访问MySQL,结果不能连上远程的MySQL服务器,然后就怀疑是MySQL的配置出了问题,所以就改配置,

第一次更改配置文件后,使用本地的mysql工具都不能登陆了,出现下边这个问题:

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38)

这是第一次修改的情景,


  1 # For advice on how to change settings please see
  2 # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
  3 
  4 [mysqld]
  5 
  6 # Remove leading # and set to the amount of RAM for the most important data
  7 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
  8 # innodb_buffer_pool_size = 128M
  9 
 10 # Remove leading # to turn on a very important data integrity option: logging
 11 # changes to the binary log between backups.
 12 # log_bin
 13 
 14 # These are commonly set, remove the # and set as required.
 15 basedir = /usr/local/mysql
 16 datadir = /usr/local/mysql/data
 17 port = 3306
 18 server_id = 1 
 19 socket = /tmp/mysql.sock
 20 max_connections = 1000
 21 default-character-set=utf8
 22 # Remove leading # to set options mainly useful for reporting servers.
 23 # The server defaults are faster for transactions and fast SELECTs.
 24 # Adjust sizes as needed, experiment to find the optimal values.
 25 # join_buffer_size = 128M
 26 # sort_buffer_size = 2M
 27 # read_rnd_buffer_size = 2M 
 28 
 29 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

第二次更改配置后连MySQL server都启动不了了,我............................琢磨了很久

Starting MySQL. ERROR! The server quit without updating PID file(cant update locahost.localdomain.pid)

这次修改:


  1 # For advice on how to change settings please see
  2 # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
  3 
  4 [mysqld]
  5 
  6 # Remove leading # and set to the amount of RAM for the most important data
  7 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
  8 # innodb_buffer_pool_size = 128M
  9 
 10 # Remove leading # to turn on a very important data integrity option: logging
 11 # changes to the binary log between backups.
 12 # log_bin
 13 
 14 # These are commonly set, remove the # and set as required.
 15 basedir = /usr/local/mysql
 16 datadir = /usr/local/mysql/data
 17 port = 3306
 18 # server_id = 1 
 19 # socket = /tmp/mysql.sock
 20 max_connections = 1000
 21 default-character-set=utf8
 22 # Remove leading # to set options mainly useful for reporting servers.
 23 # The server defaults are faster for transactions and fast SELECTs.
 24 # Adjust sizes as needed, experiment to find the optimal values.
 25 # join_buffer_size = 128M
 26 # sort_buffer_size = 2M
 27 # read_rnd_buffer_size = 2M 
 28 
 29 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

本以为 max_connections = 1000 和default-character-set=utf8两处没什么问题,结果是MySQL还是不能启动

最后我还是放弃一切修改,恢复到原来最初的位置,又回到了出发点


  1 # For advice on how to change settings please see
  2 # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
  3 
  4 [mysqld]
  5 
  6 # Remove leading # and set to the amount of RAM for the most important data
  7 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
  8 # innodb_buffer_pool_size = 128M
  9 
 10 # Remove leading # to turn on a very important data integrity option: logging
 11 # changes to the binary log between backups.
 12 # log_bin
 13 
 14 # These are commonly set, remove the # and set as required.
 15 basedir = /usr/local/mysql
 16 datadir = /usr/local/mysql/data
 17 port = 3306
 18 # server_id = 1 
 19 # socket = /tmp/mysql.sock
 20 # max_connections = 1000
 21 # default-character-set=utf8
 22 # Remove leading # to set options mainly useful for reporting servers.
 23 # The server defaults are faster for transactions and fast SELECTs.
 24 # Adjust sizes as needed, experiment to find the optimal values.
 25 # join_buffer_size = 128M
 26 # sort_buffer_size = 2M
 27 # read_rnd_buffer_size = 2M 
 28 
 29 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

 突然想起来MySQL的用户管理和用户权限设置,然后就是MySQL的用户管理创建一个新的远程用户,通过本机客户端软件是可以连接的,success!

 

Starting MySQL..... ERROR! The server quit without updating PID file是MySQL启动过程中的一个错误信息,意味着MySQL无法更新PID文件。这个问题可能由多种原因引起。可能出现此错误的原因之一是在MySQL的早期版本创建的数据库在较新的MySQL版本中无法正常工作。在升级到MySQL 5.5.7时,有用户报告了类似的错误信息。另外,也有报道称在2010年11月份出现了类似的问题。 为了解决这个问题,可以尝试以下几种方法: 1. 确保你使用的MySQL版本与你的数据库兼容。如果你在旧版本的MySQL上创建了数据库,尝试将其导出并导入到较新版本的MySQL中,然后再次尝试启动MySQL。 2. 检查PID文件的路径和权限。确保MySQL进程有权限写入PID文件所在的目录,并且文件路径设置正确。 3. 检查MySQL的日志文件以获取更多信息。在MySQL的错误日志文件中,你可能会找到有关这个错误的更详细的信息,如错误的原因和解决方法。 4. 如果你使用的是Mac或Linux系统,尝试以管理员身份运行MySQL。在终端中使用sudo命令来启动MySQL,这可能有助于解决权限问题。 5. 重启服务器。有时候,这个错误可能只是一个暂时的问题,重启服务器后,MySQL可能能够正常启动。 如果以上方法都没有解决问题,你可能需要查阅更多关于这个错误的信息,或者考虑在MySQL社区中咨询其他用户或开发人员的帮助。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [Starting MySQL. ERROR! The server quit without updating PID file......](https://blog.csdn.net/y_server/article/details/78781177)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值