Noob MySQL Question

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Noob MySQL Question

Postby SlackPack » 21. August 2006 23:34

I just installed xampp 1.5.3a and from the control page -> status tab, it shows that MySQL is "deactivated". mysql_start.bat is already up and running, what am I doing wrong?
SlackPack
 
Posts: 3
Joined: 21. August 2006 23:23

Re: Noob MySQL Question

Postby Izzy » 24. August 2006 07:40

SlackPack wrote:I just installed xampp 1.5.3a and from the control page -> status tab, it shows that MySQL is "deactivated". mysql_start.bat is already up and running, what am I doing wrong?

I have just spent some time replicating this mySQL "DEACTIVATED" issue in the Status page and have been able to turn it on and off at will.

Here is what I found.

The mySQL user pma must not have been removed from any part of your mySQL/phpMyAdmin configurations or it will give the RED flag.

Check these items:

1. Open xampp/htdocs/xampp/mysql.php in your fav. text editor.

That is what it should look like.
Code: Select all
<?php
   if (@mysql_connect("localhost", "pma", "")) {
      echo "OK";
   } else {
      echo "NOK";
   }
?>



2. Open xampp/phpmyadmin/config.inc.php in your fav. text editor.

This is what this part should look like.
Code: Select all
$cfg['Servers'][$i]['controluser']   = 'pma';          // MySQL control user settings
                                                    // (this user must have read-only
$cfg['Servers'][$i]['controlpass']   = '';          // access to the "mysql/user"
                                                    // and "mysql/db" tables).
                                                    // The controluser is also
                                                    // used for all relational
                                                    // features (pmadb)


3. Open phpMyAdmin from the XAMPP Welcome (Admin) Page in your fav browser.

Click on Privileges in the main frame.

Check you have this:
User/pma - Host/localhost - Password/NO - Global Privileges/SHUTDOWN - Grant/NO


If all the above are intact you should get the "ACTIVATED" in the Status page.

Now you may have added a root user password to improve the security of your mySQL server. In certain instances this may prevent the user pma from connecting to mySQL.

If you try this, then you will see how it is possible to turn the RED flag to Green at will, just like I did, to test out the above 3 checks.

Again in your fav. text editor open xampp/htdocs/xampp/mysql.php

Change this line:
Code: Select all
   if (@mysql_connect("localhost", "pma", "")) {

to this:
Code: Select all
   if (@mysql_connect("localhost", "root", "EnterYourRootPasswordHere")) {

Save it and try your Status page again. It should display the GREEN flag if you had a RED flag before.

Change it back and it should go RED again.

This was how I detected I had a user pma issue somewhere in my configurations.

I had deleted the pma user from the config.inc.php file and the pma user in my phpMyAdmin Privileges table.

I reinstated all the pma users and now I have all GREEN flags in the Status page.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby reginabally » 20. September 2006 10:58

Thanks for the info. But apart from this problem, I can't even access to my phpMyAdmin.

Error Message:
#1045 - Access denied for user 'pma'@'localhost' (using password: NO)

Another question:
Do I need to configure my PHP or Apache to use the username and password of MySQL?

Thanks for answering.
reginabally
 
Posts: 2
Joined: 20. September 2006 10:38
Location: Kuala Lumpur, Malaysia


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 63 guests