Jump to content

Can't Access A Remote (Tch) Mysql Database


cbutler

Recommended Posts

I'm apparently running into a software version mismatch when trying to access a remote MySQL database on my TCH reseller account.

 

Via cpanel, I've enabled the TCH-based reseller database for "%" access.

 

I'm developing on a Mac Snow Leopard system -- PHP 5.3.

 

The same user/password works fine for my PHP code running in production mode on the TCH website and also on my Mac development system. But I get "OK packet 6 bytes shorter than expected" when I try to access the remote TCH database from my Mac, using the same user/password combo.

 

Web comments suggest software mismatch, but I have no control of the TCH system. phpinfo() hasn't made the problem clear.

 

Can anybody help? I'm trying to let a client with multiple websites use a single instance of his database, instead of replicating it across all his websites.

 

I realize "localhost" is the easy solution, since all my client's websites are on the same TCH reseller account. But my client is growing and will need multiple distinct websites in the future, probably on dedicated servers.

 

Thanks for your consideration,

 

Chris Butler

 

PS: My sympathies to the TCH support crew. It seems "regression testing" is just a mild embarassment now to the developers of PHP, and all bets are off now that Oracle owns MySQL.

Link to comment
Share on other sites

Please open a ticket to my attention, along with the database name, user, and password. This issue is commonly related to the old style passwords, which we unfortunately can not disable or it would break a lot of sites.

 

Once I have this information I can correct this issue for you.

Link to comment
Share on other sites

Thanks for the prompt reply -- TCH never fails to impress me.

 

Can you give me a rough idea what's involved in the fix? I prefer not to have my client inconvenienced for long, if changing password software requires major changes in my code.

 

I'm developing on a Mac/PHP5.3 system, but I greatly appreciate that TCH hasn't made the jump to PHP 5.3 yet. I still have some clean-up works to make my TCH/PHP 5.2x websites work cleanly under 5.3.

 

Just being cautious here...

 

Chris

Link to comment
Share on other sites

Sure and the only change will be on the back end.

 

We will simply disable support of the old style passwords(temporarily so we don't break other users sites), then using the current database username and password, we will recreate the password using the new style mysql passwords. Once this is done your local setup will connect as usual with no change on your part and you will be able to properly connect using your external setup.

 

This change is something you can actually run from phpmyadmin, however, since you cant actually disable support for the old style passwords, it would have no affect from your end.

Link to comment
Share on other sites

  • 1 month later...

Dick,

 

I'm now trying to connect from my Mac development system to a MySQL database on philadelphia, and am getting the same error message about old vs new password MySQL authentication.

 

My Mac is running PHP 5.3.2, so I assume my PHP mysql_connect() code is producing the newer longer password hash.

 

I'm guessing the correct solution is to delete my MySQL user and then recreate that user, which should generate the new password hash.

 

I'd prefer to update to the newer MySQL password convention instead of working toward backward compatibility, and will change anything necessary in my PHP framework.

 

FYI, I've added my local IP address to the access list via cPanel, which is how I got as far as the old/new password conundrum.

 

I'm reluctant to offer more specifics in a public forum, but I'd appreciate your input to help me generate a coherent ticket.

 

Thanks,

 

Chris

Link to comment
Share on other sites

Bruce...

 

That database has a single user, and I already tried removing and restoring that user. I just repeated that process, and also created a new user/password. In each case, I get this error message:

 

Warning: mysql_connect(): OK packet 6 bytes shorter than expected in /websites/bbm_georgetown/shared_v4/libs/database_lib.php on line 96 Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using old authentication in /websites/bbm_georgetown/shared_v4/libs/database_lib.php on line 96

 

Other suggestions gratefully accepted...

 

Chris

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...