Forum Moderators: travelin cat

Message Too Old, No Replies

Problem with MySQL and Tiger

Can't run MySQL on Tiger

         

matiaslanzi

8:58 pm on Nov 20, 2005 (gmt 0)

10+ Year Member



It looks that the default install off mySql in Tiger Server is not working. Apple makes a happy remark sayig that we're in luck because the server is pre-insttalled, useless.

Searching in entropy.com, I found everybody complainig about the same thing, some suggestions got me to where I am now.

I'm trying a reinstall, the removal of the previous package was a bit of a mess, but I found out that it was under /usr/bin so to remove I issued:

$rm mysql*

I also got rid of /var/mysql
and a plist file in /etc

as well as any package receit in the library.

I installed the binary distribution from mysql site v4.1.15 for ppc darwin, technically everything went fine untill I tryed to connect using PHP. Could this be a PHP 4 bug?

This is the error I got:
Client does not support authentication protocol requested by server; consider upgrading MySQL client.

I'm able to connect using $mysql -u username -p
I'm able to do everything create BDs, add tables selects, grant flush, change passwords all that good stuff, but not through PHP.

That makes me think PHP is not able to get to MySQL.
At first there was no way to make PHP see the socket, now it sees it but can't authenticate.

This could also be a permissions problem.

Then I found an article in the apple website, instructions that I haven't trye yet for I don't think it's a MySQL problem. But here is the URL in case somebody want's to try.

[developer.apple.com...]

I'm afraid I can't use the OSX default installations of PHP and MySQL. Nasty isn't it?

Please let me know if you can find a solution, I'll keep trying.

timster

3:55 pm on Nov 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds like your having the same problem I ran into recently -- MySQL upgraded the way its passwords are encrypted, so you need to upgrade PHP:

[webmasterworld.com ]

Try upgrading your PHP using one of those fine packages you at that entropy site you mentioned. I upgraded to PHP 5 but the PHP 4 install should work too.

matiaslanzi

5:59 pm on Nov 21, 2005 (gmt 0)

10+ Year Member



Absolutely, MySQL uses MD5 hashes now.
I actually upgraded PHP4 without success, I guess I'll try PHP5, It's about time anyway.

As a test I downgraded MySQL and there it was.
Thanks for the tip!

BjarneDM

9:41 pm on Nov 21, 2005 (gmt 0)

10+ Year Member



It looks like you simply don't understand the issues involved with getting PHP and MySQL to work together. The Apple Mac OS X server pages states that they are shipping MySQL 4. And their PHP is either compiled against the shared libraries from that or using the embedded libraries in PHP 4. phpinfo() will tell you what Apple did and which version of the client libraries has been loaded.

[php.net...]

As I stated in the thread that timster is referring to, the libmysqlclient libraries from MySQL have changed between 4.0, 4.1 and 5.0.

In PHP 5 you no longer get the embedded libraries, so you'll have to explicitly compile PHP 5 against MySQL no matter what version of MySQL you are using - even the old 3.5.x. And the in PHP 4 embedded libraries simply won't work with MySQL 5.x. Also, if you re-install MySQL you'll have to make damned sure that the libmysqlclient shared libraries are installed in the same place as before and have the same names - otherwise you are toast. You'll also have to re-start Apache in order for Apache/PHP to pick the new libraries up. Take a look at the Apache/PHP error logs for issues regarding this.

The webpage matiaslanzi is referring to is about how to get MySQL compiled on Mac OS X Client. It's a big question whether Mac OS X Server has the MySQL stuff installed in the same places as the author of the article is using.

And being able to use mysql from the command line, but not from PHP just indicates that your Apache/PHP MySQL combination is toast.

The issues are thus:
- where are the libmysqlclient shared libraries installed
- does PHP use them
- is PHP looking for the libmysqlclient libraries in the correct place
- is PHP 4 using the embedded libraries and have you installed MySQL 5
- has PHP loaded libmysqlclient libraries that are incompatible with the MySQL version you have just installed.