Error: Could not connect to MySQL server!

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

Moderator: severin

ouvyt
Posts: 1
Joined: Fri 10. Jul 2009, 12:38

Re: Error: Could not connect to MySQL server!

Post by ouvyt » Fri 10. Jul 2009, 12:40

This worked for me as well. I changed the root password in phpmyadmin. Once I changed it back to root, everything was golden.
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,

Lacyjee
Posts: 1
Joined: Mon 24. Aug 2009, 10:33

Re: Error: Could not connect to MySQL server!

Post by Lacyjee » Mon 24. Aug 2009, 10:46

Your SQL Server is not connecting, this means your SQL files has got corrupt. Thus, first of all you need to do a recovery of the SQL files. This recovery process can be done with the Mdf Repair Software. Install this tool and make your files recovered. your SQL files can be connected. :lol:

JingCreation
Posts: 1
Joined: Sat 19. Sep 2009, 00:48

Re: re-install MAMP

Post by JingCreation » Sat 19. Sep 2009, 01:35

saads10 wrote: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
Try to re-install MAMP.

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

Re: Error: Could not connect to MySQL server!

Post by zlatan24 » Mon 7. Dec 2009, 20:14

Some days ago I had a lot of problems with sql server and files too.But to my surprise a friend advised me-repair for .mdf.Software helped me in 20 seconds and for free.Besides application showed me how it estore the entire database, the main data file (mdf format) and all secondary data files (ndf format) should be analyzed by .mdf file repair tool.

nancy86
Posts: 1
Joined: Sat 2. Jan 2010, 08:26

Re: Error: Could not connect to MySQL server!

Post by nancy86 » Sat 2. Jan 2010, 08:37

Hi,
If you are not connecting to the MySQL Server that means there must be some vulnerability in the connection, so first check it out. If it is fine then I guess the some internal .dll files or .exe files have been damaged or corrupted. So, check it out with some inbult MySQL utilities -
mysqlcheck [options] dbname tablename [tablename2... ] command to check the corruption status.
repair table tablename [,tablename1...][options] command to repair the table.

However, if the above commands fails to repair the corrupted or damaged database then use any MySQL Repair software to repair the MySQL database effectively.

Best of Luck!

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

Re: Error: Could not connect to MySQL server!

Post by zlatan24 » Tue 9. Mar 2010, 17:43

nancy86 wrote:Hi,
If you are not connecting to the MySQL Server that means there must be some vulnerability in the connection, so first check it out. If it is fine then I guess the some internal .dll files or .exe files have been damaged or corrupted. So, check it out with some inbult MySQL utilities -
mysqlcheck [options] dbname tablename [tablename2... ] command to check the corruption status.
repair table tablename [,tablename1...][options] command to repair the table.

However, if the above commands fails to repair the corrupted or damaged database then use any MySQL Repair software to repair the MySQL database effectively.

Best of Luck!
There are a lot of tools,which work with sql files. But one of them liked me and I downloaded it from a soft blog - download database recovery mdf. The tool solved my issue for seconds and absolutely free as far as I remember. Moreover the application showed me how it provides evaluation services for any database in Microsoft SQL format that cannot be opened normally; restore Microsoft SQL files.

compton83
Posts: 1
Joined: Thu 8. Apr 2010, 21:01

Re: Error: Could not connect to MySQL server!

Post by compton83 » Thu 8. Apr 2010, 21:16

Hello,
I've downloaded MAMP and at first everything worked well. But alas I got an error. So I trashed the MAMP program and re downloaded it. Everything was fine until I tried to delete my trash with the MAMP folder and got "the operation cannot be completed because the item 'mysqld_safe' is in use." My Mysql server will not connect. I tried using the killal psuedo and changing the mysql port in preference to 3306 and it still doesn't work. I'm sure it is this doc that is causing me so much grief. When I checked the mysqld_safe in the terminal I got:

Last login: Thu Apr 8 16:56:42 on ttys000
Macintosh-5:~ williamcompton$ /Users/williamcompton/Desktop/MAMP/Library/bin/mysqld_safe ; exit;
100408 16:57:37 mysqld_safe Logging to '/Applications/MAMP/db/mysql/Macintosh-5.westell.com.err'.
chown: /Applications/MAMP/db/mysql/Macintosh-5.westell.com.err: Operation not permitted
100408 16:57:37 mysqld_safe A mysqld process already exists
logout

[Process completed]

PLEASE HELP

tison
Posts: 1
Joined: Fri 15. Oct 2010, 14:30

Re: Error: Could not connect to MySQL server!

Post by tison » Fri 15. Oct 2010, 14:33

thank you franwu, changing the hard-coded password in this file did the trick: /MAMP/bin/mamp/

isablah
Posts: 1
Joined: Thu 2. Jun 2011, 15:10

Re:

Post by isablah » Thu 2. Jun 2011, 15:13

kkhipple wrote:
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.
I ended up going into MAMP/bin/MAMP/ into the index.php to find out that the port used was 3306. I changed it back to 8889 and started the servers again (on MAMP) and it works now.

thanks! Dont know why they would be changed but .. oh well.. at least it works!

chris-ben
Posts: 2
Joined: Wed 8. Jun 2011, 16:05

Re: Error: Could not connect to MySQL server!

Post by chris-ben » Sat 11. Jun 2011, 05:39

I think this has really been a bug for mamp or even the pro version. The sql connection configuration is a very plausible solution that could be altered in simple terms, would eventually mess up with the connection to mamp. I hope we could establish a standard gate that would be able to make use of it properly.

r3p0m4n
Posts: 1
Joined: Thu 16. Jun 2011, 18:59

Re: Error: Could not connect to MySQL server!

Post by r3p0m4n » Thu 16. Jun 2011, 19:14

Same problem here. Had no problem prior to 1.9.6, but now cannot start MySQL Server. I've deleted, cleared out preferences, and reinstalled MAMP. I've tried changing ports via preferences and bin/mamp/index.php. I've tried adding "--no-defaults" to bin/startMysql.sh all with no luck. Any more tips to get MAMP working again? Thanks!

areshel_vlsi
Posts: 1
Joined: Mon 22. Aug 2011, 12:09

Re: Error: Could not connect to MySQL server!

Post by areshel_vlsi » Mon 22. Aug 2011, 13:19

@tyrajosaure

man thanx thanx thanx!! I tried to write your code and restarted the mamp and I finally got the green light on MySQL server. thank you so much. meanwhile, I had changed the ports from the preferences, to ;

Apache :80
MySQL : 3306

At first they were at 8888 and 8889 , I dont know why..

opennetworking
Posts: 1
Joined: Tue 23. Aug 2011, 08:49

Re: Error: Could not connect to MySQL server!

Post by opennetworking » Tue 23. Aug 2011, 08:52

Hey, having the same problems and tried changing the port in /MAMP/bin/mamp/index.php with no luck. Has anybody figured this out? :-)

lydialynn2
Posts: 1
Joined: Wed 7. Sep 2011, 10:55

Re: Error: Could not connect to MySQL server!

Post by lydialynn2 » Wed 7. Sep 2011, 11:01

This error generally appears when SQL database gets severely corrupted. To get rid of this error, you will have to repair the corrupted SQL database. You can make use of genuine Stellar Phoenix SQL database repair software. This utility can repair sql database within few steps only and thus allows you to access it without facing any problems.

caman
Posts: 1
Joined: Sat 8. Aug 2009, 12:21

Re: Error: Could not connect to MySQL server!

Post by caman » Mon 26. Sep 2011, 17:42

I'm running Lion 10.7.1 and MAMP Pro 2.0.3
I had a problem with being unable to connect via www/mysql.
I changed the mysql root password from within the MAMP app
to the password I had selected when I installed MAMP and thus
I was able to connect straight away.

I'm not experienced at this at all, but all I can say to those in
my situation is; Don't give up, don't be too afraid to try
different solutions. It's not a vas, it won't brake. ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest