nemuzu se dostat z PHP k mySQL

Martin mic na mymail.cz
Čtvrtek Květen 5 10:28:23 CEST 2005


> v tom bych problem nevidela, nebot tentzy skript na jinem linuxu
> funguje.(konfig. PHP 4.3.1, Apache2.0.51 amysql 3.23.58)
>
>  
>
takze konkretne tento postup by mohl pomoci:

Resolving: 'Client does not support authentication protocol requested by
server'

If you get an error about client authentication version when connecting
to MySQL then it may be because your server is using the new password
format, while your mysql client (or PHP script, or JDBC code) is using
the old password format.  See:
http://dev.mysql.com/doc/mysql/en/Application_password_use.html.

You can change a new password to an old password like this:


mysql> update user set password = old_password('passwordhere') where
user = 'phpbb'; flush privileges;
Query OK, 1 row affected (0.04 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select user, password from user;
+-------+-------------------------------------------+
| user  | password                                  |
+-------+-------------------------------------------+
| root  | *BA3E2F47E409A6ABA83D219D70631A02FE28539E |
| root  | *BA3E2F47E409A6ABA83D219D70631A02FE28539E |
|       |                                           |
|       |                                           |
| phpbb | 09a6e3834c6d11c9                          |
+-------+-------------------------------------------+
5 rows in set (0.00 sec)


In this case root has a new, longer password.  While the phpbb user has
the shorter, old password format.  In PHP something like
mysql_connect('localhost', 'phpbb', 'passwordhere') should now
successfully create a connection.


Další informace o konferenci Linux