Error: Could not connect to MySQL server!

Report any found bug here. We are grateful for any useful clues.

Moderator: severin

razorx
Posts: 1
Joined: Sat 23. Jul 2005, 00:39

Error: Could not connect to MySQL server!

Post by razorx » Sat 23. Jul 2005, 00:47

Hi there,

I just downloaded and installed MAMP today. Everything worked great, and I was quite amazed at how wonderfully designed this app is.

BUT, like the others who have poosted this bug... I get the error:

"Error: Could not connect to MySQL server!"

So I removed MAMP, and installed it again. Unfortunately, the MYSql server will not start. Only the Apache server initializes.

Any clues on this..


Thanks.

franwu
Posts: 1
Joined: Mon 25. Jul 2005, 13:39

Post by franwu » Mon 25. Jul 2005, 13:59

Hi,

I just installed MAMP, and got the same error. Then I checked the index.php file under the /MAMP/bin/mamp/ folder, and found that it hard code the msyql connection username/password as root/root. If you changed the default root password (of course for security), you can modify the code in index.php to test MAMP. It worked for me.

good luck,

kkhipple
Posts: 2
Joined: Thu 4. Aug 2005, 14:05

Post by kkhipple » Thu 4. Aug 2005, 14:06

I also get the same error. however i was never given the opportunity to change the root password. so i dont know what the default is.

can anyone help?

kkhipple
Posts: 2
Joined: Thu 4. Aug 2005, 14:05

Post by kkhipple » Thu 4. Aug 2005, 14:24

kkhipple wrote:I also get the same error. however i was never given the opportunity to change the root password. so i dont know what the default is.

can anyone help?

i was able to get this working by launching MAMP and going to Preferences-> Port. And changing the MySQL port to 3306. This worked like a charm for me.

Maybe this can help someone.

perenouel
Posts: 1
Joined: Mon 29. Aug 2005, 15:31

Post by perenouel » Mon 29. Aug 2005, 15:42

hi ! :)


i had the same problem, it seams like the mySQL server doesn't want to stop and try some commands :
ps aux | grep mysql < nothing
lsof -i < ah ! my god ! mysqld !
so i tried to stop the deamon with :
killall -9 mysqld
and i restart MAMP

and it works well :)


see U all ! (sorry for my bad english, but i'm french :?)

Guntis
Posts: 3
Joined: Sat 7. May 2005, 11:22

Post by Guntis » Sat 3. Sep 2005, 22:58

kkhipple wrote:i was able to get this working by launching MAMP and going to Preferences-> Port. And changing the MySQL port to 3306. This worked like a charm for me.

Maybe this can help someone.
Thanks! It helped me too! I installed MAMP and everything was fine except MySQL didn't start. Why do they use port which is not working is beyond my understanding... Also, if I change document root for Apache in MAMP preferences, it chages root only in the first instance in httpd.conf, but there is another line little bit below, which remains unchaged. Clearly a bug...

edie-b
Posts: 1
Joined: Wed 19. Oct 2005, 01:26

same problem~

Post by edie-b » Wed 19. Oct 2005, 02:42

I installed MAMP yesterday, and had it working great. Was very impressed. Then today I go to start working on a new template and I get the Error Message:

Error: Could not connect to MySQL server!

I tried rebooting my machine but that did not work. I also tried changing the SQL Port to 3306 but that didn't work.

In the error logs I get the following message:

051019 11:29:43 [Warning] One can only use the --user switch if running as root

051019 11:29:45 InnoDB: Started; log sequence number 0 43634
051019 11:29:45 [ERROR] Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't exist
051019 11:29:45 mysqld ended

I am running MAMP 1.0.1 on OS X 10.3.9, the Apache Server Light is green but the MySQL light is Red.

Any help would be much appreciated!

bumkilla
Posts: 1
Joined: Thu 27. Oct 2005, 19:43
Contact:

Post by bumkilla » Thu 27. Oct 2005, 19:48

perenouel wrote:killall -9 mysqld
I'm just adding this because it took me a minute to figure out what exactly to do with the above suggestion. For those not all that acclimated to things like this (such as myself), copy that "killall" line and run it as a command in Terminal (mac osx) with MAMP running. Then, just hop back onto MAMP.


Works great, thanks.

tyrajosaure
Posts: 2
Joined: Fri 11. Nov 2005, 15:14

Post by tyrajosaure » Fri 11. Nov 2005, 15:19

Hi,

I have got exactly the same problem. I tried all the tricks you gave on this forum, and it still doesn't work.
The two lights are now green (Apache and MySQL) when I start MAMP, but the same message 'Error: Could not connect to MySQL server!' comes when I open the window.

Does some have another idea ?

Thanks

tyrajosaure
Posts: 2
Joined: Fri 11. Nov 2005, 15:14

Post by tyrajosaure » Sat 12. Nov 2005, 08:11

Hi!

I tried again all the ways proposed to solve this problem.
And I wrote
ps aux | grep mysql
lsof -i
killall -9 mysqld
in the Terminal and then restarted MAMP.
Exactly like perenouel did.

And it worked.

Thanks.

cayennecode
Posts: 36
Joined: Tue 24. Oct 2006, 23:52

-

Post by cayennecode » Fri 3. Nov 2006, 03:03

Just repair your permissions with Disk Utility, and restart your clomputer.

Yes I said clomputer, what?

saads10
Posts: 1
Joined: Thu 4. Jan 2007, 16:15

Post by saads10 » Fri 5. Jan 2007, 17:28

hi,

i have tried all the suggestions above but cant resolve the problem. I tried changing the port to 3306 but it doesnt save that. I tried changing it manually in startMySQL.sh but that doesnt solve the problem.

Are there any other suggestions resolving this problem.

thanks

andre0180
Posts: 1
Joined: Tue 24. Jun 2008, 14:13

Re: Error: Could not connect to MySQL server!

Post by andre0180 » Tue 24. Jun 2008, 14:17

franwu wrote:Hi,
I just installed MAMP, and got the same error. Then I checked the index.php file under the /MAMP/bin/mamp/ folder, and found that it hard code the msyql connection username/password as root/root. If you changed the default root password (of course for security), you can modify the code in index.php to test MAMP. It worked for me.
good luck,

Thank you so much!
Andre

zlatan24
Posts: 4
Joined: Tue 5. May 2009, 06:48

Re: Error: Could not connect to MySQL server!

Post by zlatan24 » Tue 5. May 2009, 06:50

Yesterday my friend advised me good tool-mdf repair,as far as I know it is free,program repair data from corrupted databases in the MS SQL Server format (files with the *.mdf extension),supports data extraction via the local area network,can save recovered data as SQL scripts, it is also possible to split data into files of any size,compatible with all supported versions of Microsoft Windows, such as Windows 98, Windows Me, Windows NT 4.0, Windows 2000, Windows XP, Windows XP SP2, Windows 2003 Server, Windows Vista,tool supports the following database formats: Microsoft SQL Server 7.0, 2000, 2005,also can repair .mdf files of Microsoft SQL Server 2005, repair mdf file of Microsoft SQL Server 2005 (64-bit).

zlatan24
Posts: 4
Joined: Tue 5. May 2009, 06:48

Re: Error: Could not connect to MySQL server!

Post by zlatan24 » Thu 25. Jun 2009, 19:15

tyrajosaure wrote:Hi,

I have got exactly the same problem. I tried all the tricks you gave on this forum, and it still doesn't work.
The two lights are now green (Apache and MySQL) when I start MAMP, but the same message 'Error: Could not connect to MySQL server!' comes when I open the window.

Does some have another idea ?

Thanks
On the whole in internet there is good tool to my mind-repair sql server,for the reason that program has many capabilities and as far as I can see it is free,utility repair data from corrupted databases in the MS SQL Server format (files with the *.mdf extension),supports data extraction via the local area network,can save recovered data as SQL scripts, it is also possible to split data into files of any size,compatible with all supported versions of Microsoft Windows, such as Windows 98, Windows Me, Windows NT 4.0, Windows 2000, Windows XP, Windows XP SP2, Windows 2003 Server, Windows Vista,tool supports the following database formats: Microsoft SQL Server 7.0, 2000, 2005,also can repair .mdf files of Microsoft SQL Server 2005, repair mdf file of Microsoft SQL Server 2005 (64-bit).

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests