Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Connecting to MySQL
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Connecting to MySQL
Connecting to MySQL
14-04-2011 10:27 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
My php code on the ccgi server connects to MySQL on Humbug and works just fine, but I'd like to do some development of the php code running locally before uploading to PlusNet. I've installed WAMP (details below) and got everything running, but when I try running the php locally it fails to connect to MySQL on Humbug with the following error:
Googling indicates that this is something to do with a change in encoded password lengths in MySQL and (if I understand correctly) the libraries used by more recent versions of php refuse to connect using the shorter ones that seem to be in use on Humbug (SELECT @@global.old_passwords, @@session.old_passwords, Length(PASSWORD('abc') yields 1, 1, 16, and I gather that the 16 would be 41 if longer passwords were in use).
Most of the stuff I read on the web about working around this seems to depend on having more control of MySQL than PlusNet provides (as far as I can tell), and in any case I'm not familiar enough with the workings of php/mysql to go poking around with settings I don't really understand. Is there anything I can do to allow code running in my local php environment to connect to my database on Humbug without the risk of breaking anything running on ccgi?
--------
Local WAMP installation:
PHP Version :5.3.0
MySQL Client API version mysqlnd 5.0.5-dev - 081106 - $Revision: 1.3.2.27 $
Could not connect: mysqlnd cannot connect to MySQL 4.1+ using old authentication
Googling indicates that this is something to do with a change in encoded password lengths in MySQL and (if I understand correctly) the libraries used by more recent versions of php refuse to connect using the shorter ones that seem to be in use on Humbug (SELECT @@global.old_passwords, @@session.old_passwords, Length(PASSWORD('abc') yields 1, 1, 16, and I gather that the 16 would be 41 if longer passwords were in use).
Most of the stuff I read on the web about working around this seems to depend on having more control of MySQL than PlusNet provides (as far as I can tell), and in any case I'm not familiar enough with the workings of php/mysql to go poking around with settings I don't really understand. Is there anything I can do to allow code running in my local php environment to connect to my database on Humbug without the risk of breaking anything running on ccgi?
--------
Local WAMP installation:
PHP Version :5.3.0
MySQL Client API version mysqlnd 5.0.5-dev - 081106 - $Revision: 1.3.2.27 $
Message 1 of 7
(1,627 Views)
6 REPLIES 6
Re: Connecting to MySQL
14-04-2011 5:01 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hi Boxersoft,
The only thing I can think is that your version is MySQL5.0 and ours is MySQL4.1
Jojo
The only thing I can think is that your version is MySQL5.0 and ours is MySQL4.1
Jojo

Message 2 of 7
(349 Views)
Re: Connecting to MySQL
14-04-2011 5:52 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hi Joanne. Yes, my version of MySQL is later than yours - but it's yours that I'm trying to connect to. Is there something I have to do to allow my installation of php5 to talk to MySQL 4.1, as your php5.x does?
Message 3 of 7
(349 Views)
Re: Connecting to MySQL
15-04-2011 1:42 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I think the problem is that the MySQL interface in PHP 5.3 changed to use the longer password format that MYSQL 4.1 and later will support but the Plusnet servers are still old format (as required up to PHP 5.2).
To achieve your primary aim installing an older version of WAMP with PHP 5.2 is probably the simplest solution. Perhaps WampServer2.0h which you can download from SourceForge?
David
To achieve your primary aim installing an older version of WAMP with PHP 5.2 is probably the simplest solution. Perhaps WampServer2.0h which you can download from SourceForge?
David
David
Message 4 of 7
(349 Views)
Re: Connecting to MySQL
15-04-2011 7:56 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
That makes sense, thanks. Downgrading to php5.2 is an option, I guess. I got the impression that there might be a way to work around the issue by setting @@session.old_passwords or something but I don't know if that's possible with the PlusNet setup. Not knowing the potential repercussions, I didn't want to fiddle with such things without advice.
Thanks for the comments.
Thanks for the comments.
Message 5 of 7
(349 Views)
Re: Connecting to MySQL
15-04-2011 2:43 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
My thoughts were that using an older version of PHP (5.2) in your WAMP installation is consistent with the current ccgi version for one thing, but most importantly respects the "without risk of breaking anything on ccgi" requirement.
David2
David2
David
Message 6 of 7
(349 Views)
Re: Connecting to MySQL
15-04-2011 4:08 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Indeed so. Thanks.
Message 7 of 7
(349 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page