Starting MySQL. ERROR!

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!

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值