Jump to content

Mysql Remote Php Connection Problem


laurin1

Recommended Posts

We are having trouble making a remote connection from our local PHP site to the TCH MySQL server. This is the errors we are getting:

 

WARNING [2] mysql_connect(): OK packet 6 bytes shorter than expected, Line: 34 in file C:\inetpub\local_intranet\website_updater.php

 

WARNING [2] mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using old authentication, Line: 34 in file C:\inetpub\local_intranet\website_updater.php

 

I've had this issue locally before, and fixed it....somehow (can't find my notes), but we cannot figure this one out. We've reset passwords. We're using PHP 5.3.1.

Link to comment
Share on other sites

Not sure if this will help. Or this.

 

 

Well, the problem with every solution that I have found, is that we do not have access to the USER tables, except by interface in CPANEL. For instance:

 

To fix this error I did the exact opposite of what that website says.

What happens is that MySQL had the password stored in the old format, change the password to the new format.

 

To check this, open the MySQL console (mysql.exe in Windows) and run:

 

SELECT Host, User, Password FROM mysql.user;

 

If the Password column is a 16-digit hexadecimal number, then the password is in the old format.

 

Then you have to execute:

 

SET PASSWORD FOR 'your_user'@'your_host' = PASSWORD ( 'your_old_password');

 

Where your_user is the user name and your_host is the hostname as appear in the corresponding columns and your_old_password' is the old password stored without encription (plain text).

 

That solved my problem.

I get access denied, whether remote or via PHPMyAdmin, to the USER table.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...