Page 1 of 1

Password for root user in Xampp Security Console?

PostPosted: 22. February 2013 18:35
by Fantasia_00
Hello Apache friends,

I am in the process of installing Xampp locally, I got Apache and MySQL running in the control panel and I am now at the step of introducing a password for phpMyAdmin/MySQL which is presently blank (no password) for the user "root". I can actually login to phpMyAdmin this way.

From information gathered in this forum, I understand I should use the Xampp Security Console to introduce a new password.

The problem is when I access the XAMPP Security Console page (http://localhost:8080/security/index.php), I do not see anymore the usual fields where you enter your old password, new password, confirm new password, etc. (which I have seen at the first stages of my arduous attempts to install Xampp...).

Instead, there is the following message:

MYSQL SECTION: "ROOT" PASSWORD
MySQL SuperUser: root
The MySQL server is not running or is blocked by a firewall! Please check this problem first ...

This is the status:

MySQL, PHP, CGI, SSI, Tomcat = activated
HTTPS, SMTP, FTP = deactivated

The security status is as follows:

These XAMPP pages... Unsecure
A MySQL server is not running or is blocked by a firewall! Unknown
PhpMyAdmin password login is enabled. Secure
A FTP server is not running or is blocked by a firewall! Unknown

Well, if there is other information I should provide, please tell me since I am very unfamiliar with server matters.

Thanks very much in advance for your help.

Re: Password for root user in Xampp Security Console?

PostPosted: 01. March 2013 22:52
by Fantasia_00
Hello,

I am sorry to post again, but I would appreciate if someone could advice on this matter.

This is not meant to rush anyone, just a reminder.

Thanks in advance.

Re: Password for root user in Xampp Security Console?

PostPosted: 02. March 2013 12:43
by JonB
"A MySQL server is not running or is blocked by a firewall! Unknown"

How do you start XAMPP?

As a first step. you should start the XAMPP Control Panel and see if the Control Panel thinks MySQL is running.

Good Luck

Re: Password for root user in Xampp Security Console?

PostPosted: 03. March 2013 01:46
by Fantasia_00
Hello,

I start Xampp using the Execute/Run as an administrator command.

The Control Panel v.3.1.0.3.1.0 opens.

I click on Start button to start Apache: 2 PIDs and 2 ports numbers appear. Green light shows.

I click on Start button to start MySQL: 1 PID and 1 port numbers appear. Green light shows.

Incidentally, these last days I started having trouble running MySQL at first try. I had to close the Panel, stop the process in the Task Manager and try again.

Thanks for your reply.

Re: Password for root user in Xampp Security Console?

PostPosted: 03. March 2013 23:51
by JonB
OK -

Are you saying it is working correctly now?

Thanks

Re: Password for root user in Xampp Security Console?

PostPosted: 05. March 2013 15:50
by Fantasia_00
Hello,

No, it is not working properly because I cannot change the root password in the Xampp Security section, which I access through:

http://localhost:8080/security/index.php

The message is:

MYSQL SECTION: "ROOT" PASSWORD
MySQL SuperUser: root
The MySQL server is not running or is blocked by a firewall! Please check this problem first ...

Just to summarize:

1. Control Panel v.3.1.0.3.1.0: Apache and MySQL running. Green lights.
2. Ports for Apache: 4499 and 8080
3. Port for MySQL: 3307
4. I can access phpMyAdmin with root user, no password (blank).
5. I have not yet attempted changing the password in phpMyAdmin.
6. I wanted first to change the password in the Xampp Security section, but I get the above message.

Thanks for your help.

Re: Password for root user in Xampp Security Console?

PostPosted: 05. March 2013 16:44
by JonB
OK - the likely 'answer' is now apparent - you changed the MySQL port.

I am not the author of the code, however I think you can 'cure' the problem by editing \xampp\security\htdocs\security.php

Code: Select all
if ($command == "mysqlroot") {
               if (($handle = @fsockopen($host, 3306, $errno, $errstr, $timeout)) == true) {
                  @fclose($handle);
                  if (@mysql_connect($host, "root", "")) {
                     $status = 1;
                  } else {
                     $status = 0;
                  }
               } else {
                  $notrun = 1;
               }
            }

- and -

\xampp\security\htdocs\xamppsecurity.php

Code: Select all
if (($handle = @fsockopen($host, 3306, $errno, $errstr, $timeout)) == true) {
      @fclose($handle);

      if(@mysql_connect($host, "root", "")) {
         $registpasswd = "no";
         mysql_close();
      } else {
         $registpasswd = "yes";
      }
      $mysqlrun = 1;
   } else {
      @fclose($handle);
      $mysqlrun = 0;


And change the MySQL port number as required. This is very clever code, but it only works on the defaults without editing.

:)

Re: Password for root user in Xampp Security Console?

PostPosted: 05. March 2013 18:16
by Fantasia_00
Hello,

Your solution worked for the initial purpose intended:

- I changed the port in the line you showed in both files you mentioned.
- I could then access the option to change the password for MySQL in Xampp Security section.
- I did change the password and it was successful.
- I closed everything: browsers, Xampp control panel, Xampp process in Windows Task Manager.
- I deleted the browsing history (except favorites) in browser (Internet Explorer 9).
- I reopened Xampp control panel (as an administrator), restarted Apache and MySQL.
- I accessed http://localhost:8080/
- I accessed phpMyAdmin login window.

But this step did not work:

- I typed my new password for root user.
- I got this message: #1045 Cannot log in to the MySQL server
- I typed no password (blank field) like I used to do and I could enter phpMyAdmin.

Why my new password is not working and the old setting is?

Thanks for your help.

Re: Password for root user in Xampp Security Console?

PostPosted: 12. March 2013 14:08
by Fantasia_00
Hello,

Can someone give me some guidance to continue solving my password problem? (See above post.)

Thanks for your time. It is very much appreciated.

Re: Password for root user in Xampp Security Console?

PostPosted: 12. March 2013 16:20
by Altrea
Fantasia_00 wrote:Why my new password is not working and the old setting is?

I don't know. In some environment the xampp security tool doesn't seem to work successful.
Why don't you want to use phpmyadmin or the mysql cli to change the password?

Best wishes,
Altrea

Re: Password for root user in Xampp Security Console?

PostPosted: 12. March 2013 18:05
by Fantasia_00
Thank you Altrea,

I did not change (create) the password in phpMyAdmin itself because I thought the only recommendable way to do it was using the Xampp Security Console.

I will give a try to your suggestion and let you know how it went.

Best regards.

Re: Password for root user in Xampp Security Console?

PostPosted: 12. March 2013 19:28
by Altrea
Recommendable ways don't use third party tools such as phpmyadmin or xampp tools.
So the only recommend way to change a password in MySQL is the MySQL command line interface (cli) but phpmyadmin is doing a good job too and is tested by thousands and thousand of webworkers