Password for root user in Xampp Security Console?

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

Password for root user in Xampp Security Console?

Postby Fantasia_00 » 22. February 2013 18:35

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.
Fantasia_00
 
Posts: 15
Joined: 06. February 2013 07:18
Operating System: Windows 7 64-bit

Re: Password for root user in Xampp Security Console?

Postby Fantasia_00 » 01. March 2013 22:52

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.
Fantasia_00
 
Posts: 15
Joined: 06. February 2013 07:18
Operating System: Windows 7 64-bit

Re: Password for root user in Xampp Security Console?

Postby JonB » 02. March 2013 12:43

"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
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Password for root user in Xampp Security Console?

Postby Fantasia_00 » 03. March 2013 01:46

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.
Fantasia_00
 
Posts: 15
Joined: 06. February 2013 07:18
Operating System: Windows 7 64-bit

Re: Password for root user in Xampp Security Console?

Postby JonB » 03. March 2013 23:51

OK -

Are you saying it is working correctly now?

Thanks
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Password for root user in Xampp Security Console?

Postby Fantasia_00 » 05. March 2013 15:50

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.
Fantasia_00
 
Posts: 15
Joined: 06. February 2013 07:18
Operating System: Windows 7 64-bit

Re: Password for root user in Xampp Security Console?

Postby JonB » 05. March 2013 16:44

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.

:)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Password for root user in Xampp Security Console?

Postby Fantasia_00 » 05. March 2013 18:16

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.
Fantasia_00
 
Posts: 15
Joined: 06. February 2013 07:18
Operating System: Windows 7 64-bit

Re: Password for root user in Xampp Security Console?

Postby Fantasia_00 » 12. March 2013 14:08

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.
Fantasia_00
 
Posts: 15
Joined: 06. February 2013 07:18
Operating System: Windows 7 64-bit

Re: Password for root user in Xampp Security Console?

Postby Altrea » 12. March 2013 16:20

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
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Password for root user in Xampp Security Console?

Postby Fantasia_00 » 12. March 2013 18:05

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.
Fantasia_00
 
Posts: 15
Joined: 06. February 2013 07:18
Operating System: Windows 7 64-bit

Re: Password for root user in Xampp Security Console?

Postby Altrea » 12. March 2013 19:28

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
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 121 guests