09/10/2018, 22:54
không connect được với Mysql????
Mysql server của tớ là version 4.1.
Tớ cài PHP 5.0.2
test phpinfo chạy vẫn tít.
Thử connect trong Command Window : mysql>mysql -u root -pmypassword, vẫn connect vô tư
thế mà thử connect đến database thì không được , báo lỗi như sau:
"warning : mysql_connect(): Client does not suport authentication protocol requested by server, consider upgrading MySQL client in c:inetpubwwwroot estphp.php online 2
khong ket noi duoc"
code la :
<?
mysql_connect("localhost", "root", "mypassword")
or die("khong ket noi duoc");
print("ket noi thanh cong");
?>
Vậy xin các bạn giúp tớ lỗi này . Thanks
p/s: muốn user của admin không phải là "root" thì thì làm thê nào ??
Thanks, mong hồi âm.
Tớ cài PHP 5.0.2
test phpinfo chạy vẫn tít.
Thử connect trong Command Window : mysql>mysql -u root -pmypassword, vẫn connect vô tư
thế mà thử connect đến database thì không được , báo lỗi như sau:
"warning : mysql_connect(): Client does not suport authentication protocol requested by server, consider upgrading MySQL client in c:inetpubwwwroot estphp.php online 2
khong ket noi duoc"
code la :
<?
mysql_connect("localhost", "root", "mypassword")
or die("khong ket noi duoc");
print("ket noi thanh cong");
?>
Vậy xin các bạn giúp tớ lỗi này . Thanks
p/s: muốn user của admin không phải là "root" thì thì làm thê nào ??
Thanks, mong hồi âm.
Bài liên quan
Tôi có cho chạy thử, vẫn chạy ngon lành dù dưới DOS hay là với Internet Explorer, với connection có UID="autreUI", pw="".
Trích từ http://www.php.net/manual/en/ref.mysql.php
chả hiểu thế nào nữa ... hỗng lẽ giờ xài lại thằng php4 seo chời
anyone can help meeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
bi giờ xin chia sẽ với các bạn đôi chút
-------------------------------------------------
"warning : mysql_connect(): Client does not suport authentication protocol requested by server, consider upgrading MySQL client " <---- về vấn đề này là do mysql 4.1 nó sử dụng thuật toán mã hóa mới mà các phiên bản cũ chưa có. Để giải quyết vấn đề này đơn giản bạn chỉ cần sử dụng hàm OLD_PASSWORD để set lại password
mysql> SET PASSWORD FOR
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
hoặc sử dụng :
mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')
-> WHERE Host = 'some_host' AND User = 'some_user';
mysql> FLUSH PRIVILEGES;
(Nguồn http://dev.mysql.com/doc/mysql/en/Old_client.html)
===============================================
còn cái vụ : Unable to lead dynamic library 'C:/php/ext/php_mysql.dll
là do vl hì hoạch mãi mà quên ... chưa restart lại máy
sao điền vào phần SQL cua IBF nó lại báo lỗi như thế này đây:
Fatal error: Call to undefined function mysql_connect() in f:\appserv2\www\store\ibf13fn\sm_install.php on line 341
Mong các bạn giúp dùm.
shell> mysql
Client does not support authentication protocol requested
by server; consider upgrading MySQL client
To solve this problem, you should use one of the following approaches:
Upgrade all client programs to use a 4.1.1 or newer client library.
When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.
Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD_PASSWORD() function:
mysql> SET PASSWORD FOR
-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
Alternatively, use UPDATE and FLUSH PRIVILEGES:
mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')
-> WHERE Host = 'some_host' AND User = 'some_user';
mysql> FLUSH PRIVILEGES;
Substitute the password you want to use for ``newpwd'' in the preceding examples. MySQL cannot tell you what the original password was, so you'll need to pick a new one.
Tell the server to use the older password hashing algorithm:
Start mysqld with the --old-passwords option.
Assign an old-format password to each account that has had its password updated to the longer 4.1 format. You can identify these accounts with the following query:
mysql> SELECT Host, User, Password FROM mysql.user
-> WHERE LENGTH(Password) > 16;
For each account record displayed by the query, use the Host and User values and assign a password using the OLD_PASSWORD() function and either SET PASSWORD or UPDATE, as described earlier.