0

I am getting the following error in MySQL

Warning: mysql_connect(): Connecting to 3.22, 3.23 & 4.0 is not supported.

How do I get around this?

My conn code is currently (excerpt) :

DEFINE ('DB_USER', '*********');
DEFINE ('DB_PASSWORD', '*********');
DEFINE ('DB_HOST', '*********');
DEFINE ('DB_NAME', '*********');

if ($dbc = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD)) { // Make the connection.

Thank you.

michaelmcgurk
  • 6,367
  • 23
  • 94
  • 190
  • What's your operating system? You probably need to downgrade your MySQL client library. – Álvaro González Dec 12 '11 at 18:45
  • I'm using Windows. I also get this message: `Server is 3.23.56`. – michaelmcgurk Dec 12 '11 at 18:49
  • Cool. I'm going to get the host to upgrade our MySQL. Thanks for the help, peeps :) – michaelmcgurk Dec 12 '11 at 18:54
  • 3
    Yep, if you are paying a monthly fee for the service, you'd better ask for something newer. MySQL 3.23 is like 10 years old, I couldn't even find an official site to download it. – Álvaro González Dec 12 '11 at 19:09
  • Thanks, Alvaro. Yep, it's pretty ancient from what I can tell. New WordPress releases require MySQL5. This is a big company who use 3.2.3 as well. Crazy. – michaelmcgurk Dec 12 '11 at 19:14
  • I think I would probably start looking for a different host. If they won't upgrade, you'll want to look around for certain. – Michael Berkowski Dec 12 '11 at 20:39
  • I would have serious concerns about your host; forget asking them to upgrade. It isn't as though major version releases of database or server technologies are superficial - mySQL 5.0 wasn't all about sweet new customized skins, these are (most importantly) major security updates as well as fundamental updates to the way they work (performance). Your host should be doing these updates for their own sake, never mind the customers! The fact that you have to ask at all speaks pretty poorly of their competence: this puts your site and any users/customers that use it a **serious and constant risk**. – Chris Baker Dec 12 '11 at 20:47

1 Answers1

0

Upgrade your MySQL Server to 5.0 (if you doesnt want "translate" problems, for eg with UDF, don't upgrade to 5.1) and if you are working with PHP, use mysqli library (it has better support than mysql). It comes with PHP 5, you must comment the mysql reference and uncomment mysqli reference. Is more easy to use and powerful.

You can found more help about mysqli here: http://php.net/manual/en/book.mysqli.php

Leandro Bardelli
  • 10,561
  • 15
  • 79
  • 116