Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Thursday, 11 June 2009

"Client does not support authentication protocol requested by server; consider upgrading MySQL client"

Did you just upgrade MySQL and got the error message:
Client does not support authentication protocol requested by server; consider upgrading MySQL client.
MySQL 5.1+ uses an authentication protocol that is incompatible with older clients. The best solution is probably to upgrade your mysql client, but there is a quick an dirty fix if want to continue using your old client: You can reset the password to the pre-4.1 format for each user that needs to use an old client program:

mysql> SET PASSWORD FOR 'username'@'localhost' = OLD_PASSWORD('thepassword');

More information available here:
http://dev.mysql.com/doc/refman/5.1/en/old-client.html

Wednesday, 6 May 2009

View the raw HTTP request body in PHP

I'm currently working on a bug where some Japanese characters are not appearing correctly on the FreeFixer web site. In the process of tracking down the problem I needed to view the raw HTTP request body that FreeFixer sends when posting information about a file or some registry data. In PHP, this can be done by calling the http_get_request_body() function. Unfortunately, this function requires a PECL extension which was unavailable in my current setup. However, this solved the problem:

$request_body = @file_get_contents('php://input');