php - Getting error: Can't connect to MySQL server on 'SERVER_IP' (99) -


i'm using php5 , mysql, fine until more 9,000 petitions send mysql server.

for example, i'm trying 10,000 insert csv file 10,000 records (lines). when loop running got error:

can't connect mysql server on '192.168.10.11' (99).

i wrote little loop 10,000 select field_id table field_id = xx , got same error.

my lamp uses debian squeeze, php5, mysql server 5.1, apache2

an important note: using mysql workbench or mysql cli there no errors, on web environment.

this my.conf

# # mysql database server configuration file. # # can copy 1 of: # - "/etc/mysql/my.cnf" set global options, # - "~/.my.cnf" set user-specific options. #  # 1 can use long options program supports. # run program --help list of available options , # --print-defaults see understand , use. # # explanations see # http://dev.mysql.com/doc/mysql/en/server-system-variables.html  # passed mysql clients # has been reported passwords should enclosed ticks/quotes # escpecially if contain "#" chars... # remember edit /etc/mysql/debian.cnf when changing socket location. [client] port        = 3306 socket      = /var/run/mysqld/mysqld.sock  # here entries specific programs # following values assume have @ least 32m ram  # formally known [safe_mysqld]. both versions parsed. [mysqld_safe] socket      = /var/run/mysqld/mysqld.sock nice        = 0  [mysqld] # # * basic settings # 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 language    = /usr/share/mysql/english skip-external-locking skip-name-resolve  wait_timeout=60 connect_timeout=10 max_allowed_packet=16m interactive_timeout=120 join_buffer_size=1m query_cache_size=128m query_cache_limit=2m table_cache=1024 sort_buffer_size=8m read_buffer_size=2m read_rnd_buffer_size=4m key_buffer = 256m key_buffer_size=64m  # # instead of skip-networking default listen on # localhost more compatible , not less secure. #bind-address       = 127.0.0.1 # # * fine tuning # #key_buffer     = 16m #max_allowed_packet = 16m thread_stack        = 192k thread_cache_size       = 8 # replaces startup script , checks myisam tables if needed # first time touched myisam-recover         = backup #max_connections        = 100 #table_cache            = 64 #thread_concurrency     = 10 # # * query cache configuration # #query_cache_limit  = 1m #query_cache_size        = 16m # # * logging , replication # # both location gets rotated cronjob. # aware log type performance killer. # of 5.1 can enable log @ runtime! #general_log_file        = /var/log/mysql/mysql.log #general_log             = 1 # # error logging goes syslog due /etc/mysql/conf.d/mysqld_safe_syslog.cnf. # # here can see queries long duration #log_slow_queries   = /var/log/mysql/mysql-slow.log #long_query_time = 2 #log-queries-not-using-indexes # # following can used easy replay backup logs or replication. # note: if setting replication slave, see readme.debian #       other settings may need change. #server-id      = 1 #log_bin            = /var/log/mysql/mysql-bin.log expire_logs_days    = 10 max_binlog_size         = 100m #binlog_do_db       = include_database_name #binlog_ignore_db   = include_database_name # # * innodb # # innodb enabled default 10mb datafile in /var/lib/mysql/. # read manual more innodb related options. there many! # # * security features # # read manual, too, if want chroot! # chroot = /var/lib/mysql/ # # generating ssl certificates recommend openssl gui "tinyca". # # ssl-ca=/etc/mysql/cacert.pem # ssl-cert=/etc/mysql/server-cert.pem # ssl-key=/etc/mysql/server-key.pem  innodb_buffer_pool_size=1024m  [mysqldump] quick quote-names max_allowed_packet  = 16m  [mysql] #no-auto-rehash # faster start of mysql no tab completition  [isamchk] key_buffer      = 16m  # # * important: additional settings can override file! #   files must end '.cnf', otherwise they'll ignored. # !includedir /etc/mysql/conf.d/ 

you're running timeout issues , many connections. try lowering wait_timeout , maybe interactive_timeout.

i don't know if you're using pdo (recommended posts i've seen here), try making mysql connection persistent 1 doesn't have keep opening new connections each update.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -