Issue running MySQL.

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

Issue running MySQL.

Postby lologirl » 28. March 2009 01:18

I am a n00b with all this and I am stuck again and need help. I was here a few days ago and was helped loads by Izzy so I thought I'd return and hope someone can point me in the right direction.

My issue is with MySQL. It is running in the background. The XAMPP control panel (I know I am not to use it, but I opened it to see what it said!) shows that MySQL is running. However when I go to http://localhost it shows that MySQL database is deactivated. Everything else is activated (except for FTP Service). Why would this be? Everything was running yesterday. MySQL is working fine when I use the cmd window.

I can't connect to MySQL using PHP, and I can't figure out why not. I am sure that the PHP coding is right.

Thanks guys.
lologirl
 
Posts: 14
Joined: 06. February 2009 05:54
Location: Ireland

Re: Issue running MySQL.

Postby Izzy » 28. March 2009 01:34

Hello, it's that someone again. :)
lologirl wrote:The XAMPP control panel (I know I am not to use it, but I opened it to see what it said!) shows that MySQL is running.
Who told you that you are not supposed to use the XAMPP Control Panel (XCP)?
It is OK to use and will give you an easy uncluttered interface to the XAMPP components, in other words you will not have open console windows all over the place just the one, XCP and if you click on the X top right it will put the XCP in the Windows System Tray - to close the XCP you use the Exit button.


In XCP you should see Apache and MySQL showing a green Running indication, is that what you see?


Next to both Apache and MySQL is a box Svc, are both those ticked?


When you go to http://localhost can you run the CD Collection demo and what do you see?


You have uninstalled and then reinstalled XAMPP at some point in time, is that correct?

lologirl wrote:Everything was running yesterday.
Did you reboot in between it running yesterday and it not working today, in other words did you turn off your PC yesterday then turn it back on today?
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Issue running MySQL.

Postby lologirl » 28. March 2009 03:58

Hey Izzy. I couldn't sleep on this side of the world so I got up to see if anyone (you) had replied. :)

Re the XCP, I've just read a good few places not to use it, and to use the http://localhost instead.

So yes, in XCP, I see both MySQL and Apache in the 'Running' state. Svc is ticked.

I believe I have uninstalled and reinstalled XAMPP about a month ago. And yes, I have rebooted the system a few times since yesterday. I have done it a few times to see would that actually help my problem.

I still have MySQL database in http://localhost showing as 'Deactivated'.
lologirl
 
Posts: 14
Joined: 06. February 2009 05:54
Location: Ireland

Re: Issue running MySQL.

Postby Izzy » 28. March 2009 04:11

XCP and http://localhost are 2 different beast - XCP is a control panel and the Welcome page is an information and links page only.



Go to start>Run... in your Task Bar.

Type sc delete mysql

Click OK

Now reboot your PC.

Go to XCP and make sure the Svc box next to MySQL is not ticked and then click the Start button to start MySQL.
After you see both Apache and MySQL are running in green go and test your bits and bobs again and hopefully you should be fine.

sc.exe is the service controller and will do no harm to your PC except remove an old mysqld service from your previous installation from the registry that may have been the cause of this issue.

Also I would Stop Apache and also remove the tick in the Svc box and then Start Apache again.

Now when ever you boot your PC you will have to start XCP and manually start Apache and MySQL which in my opinion is the preferred method - this way you are sure that all is well when starting the XAMPP components and there is a modicum of security not having the web server and MySQL running all the time to be hacked by unscrupulous little script kiddies. :).

Please let me know if the sc delete mysql worked.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Issue running MySQL.

Postby lologirl » 28. March 2009 04:53

*buys Izzy a pint*
Hi Izzy, I did exactly as you told me. After the sc delete mysql bit, I restarted the computer and in http://localhost I now have MySQL activated!
So now I have found that my PHP script isn't connecting to the database . . . but that's a whole other problem. I'm delighted with your help as I was completely stuck with that one.

Thanks a million.

EDIT: Izzy since doing what you told me I can't access MySQL from my cmd window, as I usually do.
When I put in my password, I get;
Code: Select all
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

and net start mysql now returns
Code: Select all
The service name is invalid.

Is this because of doing the sc delete mysql?
lologirl
 
Posts: 14
Joined: 06. February 2009 05:54
Location: Ireland

Re: Issue running MySQL.

Postby Izzy » 28. March 2009 05:11

Your welcome and now perhaps you can get some shut eye over in the Emerald Isle.

lologirl wrote:*buys Izzy a pint*
I'll drink to that. :D

Perhaps we can also help with your MySQL connection issue if you can't fathom it out?

Good luck and I hope now you may enjoy your XAMPP experience.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Issue running MySQL.

Postby lologirl » 28. March 2009 05:24

Izzy did you see my edit about the way I can't get MySQL to actually work even though it is apparently running? Maybe I shouldn't have edited my post, I think we missed eachother. :?
lologirl
 
Posts: 14
Joined: 06. February 2009 05:54
Location: Ireland

Re: Issue running MySQL.

Postby Izzy » 28. March 2009 06:54

Just seen your edit - do you want your pint back? :)
lologirl wrote:EDIT: Izzy since doing what you told me I can't access MySQL from my cmd window, as I usually do.
When I put in my password, I get;
Code: Select all
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

and net start mysql now returns
Code: Select all
The service name is invalid.

I get the same error result if I try and use net start mysql when MySQL is not installed as a service.

You can install the MySQL service in XAMPP by going to C:\xampp\mysql folder.
Double click on mysql_installservice.bat file.

Check in XCP that there is a tick is in the Svc box and MySQL has the green running indication.

Now if you type net start mysql it will tell you the service is already running.

Next go back to the XCP and Stop MySQL but leave the tick in the Svc box.

Now issue the command net start mysql and it should start the service.

Check by looking in the XCP for the green running next to MySQL.

All should now be working again with no errors. :)

You can now run mysql from a command console window in C:\xampp\mysql\bin folder.
start>Run...
type
cmd
type
cd C:\xampp\mysql
type at the C:\xampp\mysql\bin> prompt
mysql
at the mysql> prompt type
\?
to test it works.

You can also type mysqladmin at the C:\xampp\mysql\bin> prompt in the bin folder which will give a long list of commands or type your usual commands you typed before but remember if you did not create your database in XAMPP then it may not be available until you export/import from the other instance.


IMHO, phpMyAdmin has a GUI for MySQL and for most people is much easier than the command line - http://localhost/phpmyadmin - user root no password unless you set one in the Security page in the XAMPP Welcome Page - http://localhost/security
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Issue running MySQL.

Postby lologirl » 28. March 2009 07:36

Yes - do you know what, I did install MySQL as a seperate service as back when I was installing everything I thought I had to install MySQL and PHP as well as XAMPP. . . . So I guess I should install them now. Hmmm.

Anyway I think you are my angel a the other side of the world. There was no way I was going to figure this out without you.

Meanwhile I am trying to get my PHP to talk to my MySQL, I'm still working on it but just wanted to reply back to let you know that that worked.
You can drink that beer now, but it's probably gone warm. :(
lologirl
 
Posts: 14
Joined: 06. February 2009 05:54
Location: Ireland

Re: Issue running MySQL.

Postby Izzy » 28. March 2009 07:45

lologirl wrote:Yes - do you know what, I did install MySQL as a seperate service as back when I was installing everything I thought I had to install MySQL and PHP as well as XAMPP. . . . So I guess I should install them now. Hmmm.
Hmmm Please! No, No don't do this or you will be back to square one and up a dirt creek without a paddle again. :D

Well I suppose it won't matter if you do as you now know how to fix.


BTW I drank the dark one but chilled it first as the journey it took to get here was long and hot - cheers!!!

Good luck and you sleep well now.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Re: Issue running MySQL.

Postby lologirl » 28. March 2009 07:58

Izzy wrote:No, No don't do this or you will be back to square one and up a dirt creek without a paddle again.
Sorry Izzy - that was a typo!!! I meant 'uninstall'.
Guess what I managed to do! I now have PHP talking to MySQL and displaying the results in my browser! I wouldn't have done this without you. You saved my life. Maybe I can get some zzzzzzzzs now. It's nearly 7am over here!
lologirl
 
Posts: 14
Joined: 06. February 2009 05:54
Location: Ireland


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 122 guests