SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Warning: MySQL: Link to server lost, unable to reconnect

    Hi I sometimes get this error on mysql. I run it with php and apache on win2k. I suspect its a windows problem?

    This problem is even more prevalent on a site I'm making that has more users. The error happens daily.

    is there some configuration that can be dome to optimize mysql on windows?

    the specs of the server is: win2k,apache 1.3.20,mysql 3.23.32, php4.06, 512MB ram.

    thanks!

  2. #2
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think this is close to (or may include) your error, so you might want to look at it: www.mysql.com/doc/en/Gone_away.html

    first thing i'd do is upgrade to MySQL 3.23.51 and PHP 4.2.2. are you sure that MySQL isn't crashing and then restarting around when this happens (check its uptime afterwards like it says on that page)?

    Originally posted by soned
    This problem is even more prevalent on a site I'm making that has more users. The error happens daily.
    is this happening on 2 different servers? are they both the same specs?
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the reply dr. pepper


    ahh, the specs I gave was for the site that more people connect to. the first one is just development, so it's ok.

    but on the production site, which crashes daily, the error is such that you'll need to issue "net stop mysql" and "net start mysql" all over again - it's like rebooting the database to be able to use the service again.

    I guess another problem is that I'm using phpdev4 to run the site. They say it wasn't configured for production.

  4. #4
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    interesting... so MySQL is still "running" when this happens since you have to stop the service, but yet it won't accept connections?

    yeah, like i said it'd probably be a good idea to install the latest versions of PHP and MySQL yourself. don't know if it would fix the problem or not, but there's a good chance.

    if you want, you can post the contents of your C:\my.cnf or \WINNT\my.ini file along with the output of SHOW VARIABLES and i'll see if there's anything that could be adjusted.


    P.S. have you noticed if there's anything in your error log (it should be mysql.err in your MySQL data directory) that has any info about these crashes? like saying that something went wrong or anything?
    Last edited by DR_LaRRY_PEpPeR; Aug 13, 2002 at 21:07.

  5. #5
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi dr. pepper,

    my.cnf has these settings:

    i can't access the logs yet, coz its in a remote location.


    set-variable = thread_stack=128K
    set-variable = flush_time=1800
    set-variable = key_buffer=32M
    set-variable = max_allowed_packet=1M
    set-variable = table_cache=256
    set-variable = sort_buffer=1M
    set-variable = record_buffer=1M
    set-variable = myisam_sort_buffer_size=64M
    set-variable = thread_cache=20


    i'm just waiting for firepages to have phpdev5 out of beta soi can install the new versions of php and mysql.

    thanks

  6. #6
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it's pretty easy to install all of the things yourself and not use any of the packages (although maybe it's hard once you've had a package installed). that way you can always get the latest version of things...

    ok, your my.cnf -- that's its contents exactly? 'cause that stuff should be under a [mysqld] section. anyway, i'll assume that it's the config file that MySQL IS actually using.

    i see you have a value for flush_time. this can and should probably be set to 0. from the MySQL manual:

    flush_time If this is set to a non-zero value, then every flush_time seconds all tables will be closed (to free up resources and sync things to disk). We only recommend this option on Windows 9x/Me, or on systems where you have very little resources.

    how about changing your file to the following and restart MySQL

    Code:
    [client]
    port = 3306
    
    [mysqld]
    port = 3306
    skip-locking
    set-variable = max_connections=300
    set-variable = max_allowed_packet=16M
    set-variable = key_buffer=16M
    set-variable = myisam_sort_buffer_size=64M
    set-variable = join_buffer=1M
    set-variable = record_buffer=1M
    set-variable = sort_buffer=2M
    set-variable = table_cache=1024
    set-variable = thread_cache_size=32
    set-variable = wait_timeout=600
    
    [mysqldump]
    quick
    set-variable = max_allowed_packet=16M
    
    [mysql] 
    no-auto-rehash
    
    [myisamchk]
    set-variable = key_buffer=48M
    set-variable = sort_buffer=64M
    set-variable = read_buffer=8M
    set-variable = write_buffer=8M
    if you have the `basedir=' or `datadir=' lines in your current file, be sure to put them into this one too (under [mysqld]).

    see if that helps any.

    this may be a problem with PHP and not MySQL. when MySQL "crashes" are you able to connect to it without a PHP script (command line, etc.)? if not, it must be a MySQL problem. if you can, PHP.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •