Page 1 of 1

Problem with phpMYAdmin & mySQL? *STILL NEED HELP*

PostPosted: 30. July 2008 21:42
by sweebez
Greetings,

I'm brand new to all of this scene, and my ultimate goal is to get oscommerce working with XAMPP. Right now, I cannot get into phpMYAdmin, because the error message says "Cannot load mcrypt extension. Please check your PHP configuration."

I look at phpinfo, and I think it is already enabled.
Just to be sure, here's the link to the php.ini file:
http://www.geocities.com/zacharysweebe/php-ini.txt

UPDATE: I made a sample file to test out mysql. This is the code:
Code: Select all
<?php
$conn = mysql_connect("localhost", "root", "*MYPASSWORD*");
$result = mysql_list_dbs($conn);
while($db_data = mysql_fetch_row($result)) {
echo "<b> $db_data[0]</b><br>";
}
?>

I get this error when running it:
"Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\xampp\htdocs\db.php on line 2"

What is going on???

PostPosted: 30. July 2008 22:36
by glitzi85
Hi,

find this line in your php.ini:

Code: Select all
;extension=php_mcrypt.dll


and remove the Semicolon from the beginning of the line. Then restart your Apache and try it again.

Be sure to edit the correct php.ini File, phpinfo will say you which one you have to use.

glitzi

PostPosted: 30. July 2008 22:45
by sweebez
Ok, I made the changes you suggested, and when I go to log into phpMYAdmin the "Cannot load mcrypt extension. Please check your PHP configuration." message is gone (Thanks!)
However, I still see this error:
Image
======================
When I run the code I listed before, I get the same error messages:

Code: Select all
"Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\xampp\htdocs\db.php on line 2

Warning: mysql_list_dbs(): supplied argument is not a valid MySQL-Link resource in C:\xampp\htdocs\db.php on line 3

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\db.php on line 4"

======================
When I run XAMPP's Demo CD Collection program now, I get this message:
Code: Select all
"Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in C:\xampp\htdocs\xampp\cds.php on line 64

Could not connect to database!
Is MySQL running or did you change the password?"

It's right! I *did* change the password. I was told that I should add some passwords to secure the system.
The changes I made are visible here:
Image
It seems that after making these changes, these problems have arisen.

So any ideas now?

PostPosted: 02. August 2008 02:04
by sweebez
*bump*

PostPosted: 03. November 2008 23:57
by genu
same problem. this occurs when I switched the PHP to 4. Mcrypt shows up in phpinfo, but phpmyadmin returns: "Cannot log in to the MySQL server" when trying to login.

PostPosted: 04. November 2008 00:58
by Sharley
genu wrote:same problem. this occurs when I switched the PHP to 4. Mcrypt shows up in phpinfo, but phpmyadmin returns: "Cannot log in to the MySQL server" when trying to login.

I have just successfully swapped from php5 to php4 and back again using the .\xampp\php-switch.bat file without any issues at all including logging into phpMyAdmin on each swap, with and without a password and with mcrypt uncommented in my original .\xampp\apache\bin\php.ini file.

Make sure that all the XAMPP components are stopped including if you have them running as services.

I use the cookie method of authentication for phpMyAdmin in the .\xampp\phpMyAdmin\config.inc.php file - this seems to be the most stable for me.
Code: Select all
$cfg['Servers'][$i]['auth_type']     = 'cookie';      // Authentication method (config, http or cookie based)

Try using different methods by changing it (cookie and http work for me but not config), save the file then restart apache.

Let us know how you get on and maybe post any error messages that you may come across.

My test to see if your post was anything version related seems to be negative - I am currently using XAMPP 1.6.8 but I have not had any issues with switching even in the many previous versions I have used where switching was a feature of XAMPP.

http://www.apachefriends.org/en/xampp-windows.html#1171
http://www.apachefriends.org/en/xampp-windows.html#1172

PostPosted: 11. November 2008 14:19
by dp1
I've just set up XAMPP 1.6.8 and I've had the same problem.
It appears to be caused by the MySQL password format changing. It would appear that the MySQL client library supplied with the php 4 configuration do not support the newer (post MySQL 4.1) passwords.
If, as I did, you created a root passwords using PHP 5 and XAMPP 1.6.8 you will not be able to login using PHP 4 to MySQL.

To fix this, switch back to PHP 5. Login to phpMyAdmin and for each user you've created a password for (including root) do the following:

Edit the user and change the password (can be the same password) using the "Password Hashing: MySQL 4.0 compatible" option instead of the "MySQL 4.1+" option.

You will find the password option in:
"privilidges section" and then edit each user using the icon at the end of each users details. The "change password" for that user is then listed with other options that can be changed.

Once you've done this you should be able to switch back to PHP 4 and then login correctly to phpMyAdmin (and the databases using your php scripts).

It worked for me.