110 ошибка mysql

I am trying to connect to my mySQL server through localhost on my dedicated server, but I keep getting the error:

Lost connection to MySQL server at 'reading initial communication packet', system error: 110

CODE:

<?php

$link = mysql_connect('localhost', '****', '****'); 
if (!$link) { 
    die('Could not connect: ' . mysql_error()); 
} 

I haven’t configured a firewall, so all ports should be open. What do I need to do? I have already checked several other similar questions, but none of them solved my problem. I am not connecting remotely.

UPDATE

Okay I found the issue with the connection to the server (I was connecting twice). I am able to connect now to the server, but when I run any query, the server returns FALSE. I have used this code before and it has worked before, but now that I have changed servers, it is not working.

Thanks,

David

I have a website which connects to a DB remotely, this has been the case for well over a year and i haven’t had any issues.

However when browsing the website today i noticed the mysql connection seemingly timing out. Sometimes the page loads perfectly fine then other times it generates the following warning.

Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at    'reading initial communication packet', system error: 110 in xxx/mysql_info.php on line 7
Lost connection to MySQL server at 'reading initial communication packet', system error: 110 - It seems we are having a slight technical issue, please check back soon.

I’m at a bit of a loss due to the sporadic nature of it. I have control over both the DB server and the hosting server, i haven’t changed any settings on either.

Any ideas?

asked Jul 30, 2012 at 15:51

cosmicsafari's user avatar

cosmicsafaricosmicsafari

3,88911 gold badges37 silver badges56 bronze badges

It looks like error # 110 is connection timed out. It could be a DNS or routing related issue, or your database server could be having some intermittent problems. I’d do a backup on the database asap, then look at fsck to see if the disks are ok, and do some ping and network tests to see if its reachable from your web server.

answered Jul 30, 2012 at 16:00

Robert's user avatar

2

We’ve just upgraded our existing MySQL5.1 DB servers to newer (much better) hardware with MySQL 5.5, and things have been going mostly smoothly for almost 6 weeks.

Just the last few days, I’ve noticed a few errors, such as:

From a MySQL Slave:

[ERROR] Error reading packet from server: Lost connection to MySQL server during query ( server_errno=2013)

Or From Apache/Other:

Lost connection to MySQL server at ‘reading initial communication packet’, system error: 110

At one point this evening, many webnodes reported this error for a three minute period (many such reports as this was in a busy period). However, the issues don’t appear to correspond with any times of extreme load. For all intents and purposes, the connection/thread load on MySQL is at a normal rate (between about 10 and 40 connected threads), and Web load has been a LOT higher at times over the last few weeks.

Could there bee other reasons for these connection errors, that I’m not seeing?

asked Jun 6, 2011 at 22:11

kwiksand's user avatar

1

Hooray, tuning the max_allowed_packet variable, increasing its value and restart MySQL. It will provide major capacity for MySQL in reading packets. Try it out and give us a feedback.

answered Jun 14, 2011 at 15:12

Wagner Bianchi's user avatar

2

error 110 is «Connection timed out», which suggests that something is happening to the network between your client and MySQL server. Aside from network issues, you could also see this if the server is far too overloaded to respond to the incoming connection.

answered Jan 17, 2013 at 21:21

Michael Hampton's user avatar

Michael HamptonMichael Hampton

242k43 gold badges500 silver badges964 bronze badges

you can try upping wait-timeout or connect-timeout, but this may be masking the root issue. you may have a bad query making mysql processes stack up. check (or enable) your sql slow log. run mysqltuner to possible adjust variables. read the tuning mysql section of mysql docs, and make sure your directives are sane.

EDIT: on the application layer, ie php, you can have the php script die if it does not finish within a period of time, by adjusting the max_execution_time directive

answered Nov 27, 2013 at 0:37

nandoP's user avatar

nandoPnandoP

2,00114 silver badges15 bronze badges

Skip to content

GitLab

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert

  • /


  • Help

    • Help
    • Support
    • Community forum

    • Submit feedback
    • Contribute to GitLab

    • Switch to GitLab Next
    Projects
    Groups
    Topics
    Snippets

  • Register

  • Sign in


Last edited by Ruan
May 18, 2023
Page history

MySQL Errors

It’s happing to me also
Version 0.8.8b

Screen Shot 2019-04-03 at 9 03 20 AM

cur_time='0.000000', avg_time='0.000000', total_polls='1972', failed_polls='1972', availability='0.0000' WHERE id='4398''
04/03/2019 11:25:46 AM - SPINE: Poller[0] ERROR: SQL Failed! Error:'2013', Message:'Lost connection to MySQL server during query', SQL Fragment:'INSERT INTO poller_output (local_data_id, rrd_name, time, output) VALUES (109630,'ib_lock_time','2019-04-03 11:25:33','1036226'),(109631,'ob_lock_time','2019-04-03 11:25:33','1036750'),(109632,'cpu_util','2019-04-03 11:25:33','5'),(109633,'tot_ob_packets','2019-04-03 11:25:33','68571863'),(109634,'total_OB_KBs','2019-04-03 11:25:33','24781541'),(109635,'total_IB_bytes','2019-04-03 11:25:33','19354646'),(109636,'ob_current_esn0','2019-04-03 11:25:33','1441'),(109637,'ib_current_power','2019-04-03 11:25:33','11'),(109638,'ob_pckts_16apsk2p3','2019-04-03 11:25:33','2164'),(109639,'ob_pckts_16apsk3p4','2019-04-03 11:25:33','5630'),(109640,'ob_pckts_16apsk4p5','2019-04-03 11:25:33','10827'),(109641,'ob_pckts_16apsk5p6','2019-04-03 11:25:33','68229'),(109642,'ob_pckts_16apsk8p9','2019-04-03 11:25:33','0'),(109643,'ob_pckts_16apsk9p10','2019-04-03 11:25:33','0'),(109644,'ob_pckts_32apsk3p4','2019-04-03 11:25:33','0'),(109645,'ob_pckts_32apsk4p5','2019-04-03 11:25:33','0'),(109646,'ob_pckts_32apsk5p6','2019-04-03 11'
04/03/2019 11:25:47 AM - SPINE: Poller[0] ERROR: SQL Failed! Error:'2013', Message:'Lost connection to MySQL server during query', SQL Fragment:'INSERT INTO poller_output (local_data_id, rrd_name, time, output) VALUES (109704,'ib_lock_time','2019-04-03 11:25:33','771745'),(109705,'ob_lock_time','2019-04-03 11:25:33','771740'),(109706,'cpu_util','2019-04-03 11:25:33','6'),(109707,'tot_ob_packets','2019-04-03 11:25:33','51030558'),(109708,'total_OB_KBs','2019-04-03 11:25:33','18456464'),(109709,'total_IB_bytes','2019-04-03 11:25:33','14334486'),(109710,'ob_current_esn0','2019-04-03 11:25:33','1316'),(109711,'ib_current_power','2019-04-03 11:25:33','10'),(109712,'ob_pckts_16apsk2p3','2019-04-03 11:25:33','5422'),(109713,'ob_pckts_16apsk3p4','2019-04-03 11:25:33','7919'),(109714,'ob_pckts_16apsk4p5','2019-04-03 11:25:33','6252'),(109715,'ob_pckts_16apsk5p6','2019-04-03 11:25:33','44522'),(109716,'ob_pckts_16apsk8p9','2019-04-03 11:25:33','0'),(109717,'ob_pckts_16apsk9p10','2019-04-03 11:25:33','0'),(109718,'ob_pckts_32apsk3p4','2019-04-03 11:25:33','0'),(109719,'ob_pckts_32apsk4p5','2019-04-03 11:25:33','0'),(109720,'ob_pckts_32apsk5p6','2019-04-03 11:25'
04/03/2019 11:25:46 AM - SPINE: Poller[0] ERROR: SQL Failed! Error:'2013', Message:'Lost connection to MySQL server during query', SQL Fragment:'INSERT INTO poller_output (local_data_id, rrd_name, time, output) VALUES (110148,'ib_lock_time','2019-04-03 11:25:34','91900'),(110149,'ob_lock_time','2019-04-03 11:25:34','91924'),(110150,'cpu_util','2019-04-03 11:25:34','8'),(110151,'tot_ob_packets','2019-04-03 11:25:34','9925685'),(110152,'total_OB_KBs','2019-04-03 11:25:34','8756296'),(110153,'total_IB_bytes','2019-04-03 11:25:34','1013845162'),(110154,'ob_current_esn0','2019-04-03 11:25:34','1396'),(110155,'ib_current_power','2019-04-03 11:25:34','15'),(110156,'ob_pckts_16apsk2p3','2019-04-03 11:25:34','53762'),(110157,'ob_pckts_16apsk3p4','2019-04-03 11:25:34','276693'),(110158,'ob_pckts_16apsk4p5','2019-04-03 11:25:34','463820'),(110159,'ob_pckts_16apsk5p6','2019-04-03 11:25:34','4035414'),(110160,'ob_pckts_16apsk8p9','2019-04-03 11:25:34','0'),(110161,'ob_pckts_16apsk9p10','2019-04-03 11:25:34','0'),(110162,'ob_pckts_32apsk3p4','2019-04-03 11:25:34','0'),(110163,'ob_pckts_32apsk4p5','2019-04-03 11:25:34','0'),(110164,'ob_pckts_32apsk5p6','2019-04-03 '
04/03/2019 11:25:47 AM - SPINE: Poller[0] ERROR: SQL Failed! Error:'2013', Message:'Lost connection to MySQL server during query', SQL Fragment:'UPDATE host SET status='3', status_event_count='0', status_fail_date='2019-03-28 12:45:00', status_rec_date='2019-03-28 12:30:00', status_last_error='Host did not respond to SNMP, UDP: Ping timed out', min_time='0.000000', max_time='0.000000', cur_time='0.000000', avg_time='0.000000', total_polls='1249', failed_polls='2', availability='99.8399' WHERE id='4404''
04/03/2019 11:25:47 AM - SPINE: Poller[0] ERROR: SQL Failed! Error:'2013', Message:'Lost connection to MySQL server during query', SQL Fragment:'UPDATE host SET status='3', status_event_count='0', status_fail_date='0000-00-00 00:00:00', status_rec_date='2019-03-27 13:05:00', status_last_error='Host did not respond to SNMP, UDP: Ping timed out', min_time='0.000000', max_time='0.000000', cur_time='0.000000', avg_time='0.000000', total_polls='1496', failed_polls='1', availability='99.9332' WHERE id='4402''

mysql config

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

[mysqld]
#
# * Basic Settings
#
back_log                        = 300
open-files-limit        = 8192
# open-files                    = 1024
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
skip-name-resolve

#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1
#
# * Fine Tuning
#
key_buffer              = 1M #global buffer
thread_cache_size               = 100 #recommend 5% of max_connections

myisam_sort_buffer_size         = 128M  #index buffer size for creating/altering indexes
myisam_max_sort_file_size       = 256M  #max file size for tmp table when creating/alering indexes
myisam_repair_threads           = 4     #thread quantity when running repairs
myisam_recover                  = BACKUP        #repair mode, recommend BACKUP

# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
#max_connections        = 100
#table_cache            = 64
thread_concurrency     = 16
#
# * Query Cache Configuration
#
query_cache_size                = 32M   #global buffer
query_cache_limit               = 512K  #max query result size to put in cache
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
# general_log_file        = /var/log/mysql/mysql.log
# general_log             = 1
#
# Error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
log_slow_queries       = /var/log/mysql/mysql-slow.log
long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id              = 1
#log_bin                        = /var/log/mysql/mysql-bin.log
expire_logs_days        = 10
max_binlog_size         = 256M  #max size for binlog before rolling
#binlog_do_db           = include_database_name
#binlog_ignore_db       = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem

## Per-Thread Buffers * (max_connections) = total per-thread mem usage
thread_stack                    = 256K    #default: 32bit: 192K, 64bit: 256K
sort_buffer_size                = 1M      #default: 2M, larger may cause perf issues
read_buffer_size                = 1M      #default: 128K, change in increments of 4K
read_rnd_buffer_size            = 1M      #default: 256K
join_buffer_size                = 134217728 #default: 128K
binlog_cache_size               = 64K     #default: 32K, size of buffer to hold TX queries
## total per-thread buffer memory usage: 8832000K = 8.625GB

## Connections
max_connections                 = 2000  #multiplier for memory usage via per-thread buffers
max_connect_errors              = 100   #default: 10
concurrent_insert               = 2     #default: 1, 2: enable insert for all instances
connect_timeout                 = 30    #default -5.1.22: 5, +5.1.22: 10

max_heap_table_size = 1073741824
max_allowed_packet              = 16777216   #max size of incoming data to allow
tmp_table_size = 134217728

[mysqldump]
quick
quote-names
max_allowed_packet      = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer              = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/

Понравилась статья? Поделить с друзьями:
  • 11 пп датчик hard ошибка
  • 11 ошибок руководителя книга
  • 11 код ошибки при установке isdone dll
  • 11 tp read fail mitsubishi ошибка
  • 11 kuehlerausgangstemperatur ошибка