0

I have a server with a MySQL connection that I'd like to be persistent.

I've tried a few different ways to deal with it, and I'm told that "ping()" should reconnect if there's no connection. However, ping() actually gives the same error as other calls.

Does anyone have any suggestions on how to revive connections or some setting I can use to prevent timeouts.

Matt Fenwick
  • 48,199
  • 22
  • 128
  • 192
xanderflood
  • 826
  • 2
  • 12
  • 22

1 Answers1

1

Since MySQL 5.0.14, mysql_ping() does not automatically reconnect your connection. See my previous answer on how you might get around this.

However, there may be a better way to solve your "MySQL Server has gone away" error, see this answer.

Community
  • 1
  • 1
bhamby
  • 15,112
  • 1
  • 45
  • 66