SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket/var/run/mysqld/mysqld.sock (11)

Found one answer for 11 error. It seems to be not the correct data for the connection, but everything is correctly indicated, it works. Sometimes this error is written to my log files.

I use MyISAM tables, I know that InnoDB only blocks the row, not the entire table, unlike the 1st type, but there seems to be a limit on the number of rows I read once and the sample is faster than the 1st type of tables.

my.cnf:

 socket = /var/run/mysqld/mysqld.sock nice = 0 [mysqld] user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp lc-messages-dir = /usr/share/mysql skip-external-locking bind-address = 127.0.0.1 Fine Tuning # key_buffer = 8192M max_allowed_packet = 16M thread_stack = 192K thread_cache_size = 64 # This replaces the startup script and checks MyISAM tables if needed # the first time they are touched myisam-recover = BACKUP max_connections = 1000 #table_cache = 64 table_cache = 1024 #thread_concurrency = 10 # # Query Cache Configuration # query_cache_limit = 2M query_cache_size = 128M #query_cache_type = 1 
  • And in the logs /var/log/mysql/error.log there is nothing interesting? If there are no logs, look for them in the data directory. - cheops
  • Do you have this error now constantly or does it occur from time to time? - cheops
  • In logs /var/log/mysql/error.log is empty No, not always this error Something in this editor does not work the transfer of lines, not 2 spaces, not <br/> - Anton
  • Here's another thing to do; see the maximum number of connections show variables like 'max_connections'; and the maximum achieved show status like 'Max_used_connections'; - there were no situations when you approached the maximum number of connections? 11 - most likely your server does not pull the load, but it needs more information about your server, the load that in my.cnf, it would be generally good to watch the server. - cheops
  • max_connections 1000 instead of 100 set, allocated 8 GB of RAM for the buffer. Now at least the database does not hang and there are no errors that many connections. - Anton

0