Jump to content

Help accessing MySql on MAMP


virtual

Recommended Posts

I previously had PHP and MySql set up on my Mac, but after changing computers, transfering the whole hard drive to the new computer and updating to Leopard, the computer refused to connect to localhost. After hours with Mac support, they informed me that the upgrade to Leopard had probably corrupted something and to try MAMP.

 

So I have set up MAMP but want to change the MySql root password, however when I type mysql -u root in Terminal I get the following reply

-bash: mysql: command not found

I guess this is because it is looking for the original mysql not the MAMP version. I am a total programming noob, but I have looked all over the internet to find how to access this version. Most of the replies are written in gobbledy gook, and I am scared to try start entering just anything into Terminal without comprehending what I'm doing.

 

Could some kind person here please tell me exactly what I need to type to access this and set a new password.

 

Thanks in advance for your help

Link to comment
Share on other sites

I think that I need to change my default path in .profile, to access the MAMP MySql, for the moment it is

export PATH="$PATH:/usr/local/mysql/bin"

 

Should I change this to

$link = mysql_connect('localhost', 'root', 'root');

 

Please help

Link to comment
Share on other sites

As far as I know, you shouldn't need to mess with the terminal at all... I've never needed to.

 

-- install MAMP

-- run MAMP.app

-- When MAMP.app starts, make sure that the servers are running correctly, and click "open start page". That will give you the localhost address you need to work with MAMP (and it will show you what username/password is currently active for accessing mysql)

-- your mysql username and password can be changed by using phpMyAdmin and changing the settings under "Privileges"

Link to comment
Share on other sites

Help again,

I changed my Mysql password in PHPmyadmin a couple of days ago. Today I tried testing a site and that was fine, then I tried to go to the MAMP start page to get into PHPmy admin and got this error

Error: Could not connect to MySQL server!

 

This is the address the start page showed:

http://localhost/MAMP/?language=English

 

What did I do wrong????

Link to comment
Share on other sites

"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,"

http://forum.webedition.de/phpBB/viewtopic.php?t=115

 

This may be the source of your problem... Looks like you may need to open that index.php file in your code editor and make sure that it is using the correct username/password details.

 

If that doesn't work for you, check the link above, since it includes other fixes for this issue.

 

Or check this as well:

 

http://twob.net/journal/fix-for-mamp-mysql/

Link to comment
Share on other sites

Fabulous, the first option worked, it was hard coded into the index.php. Thank you so much for helping me out.

 

Great. :) Glad to help. I'll keep this issue in mind in case others run into it. Most people don't usually change their username/password on their local install of MySQL since security is less of a problem than on a live server, but it may come in handy.

Link to comment
Share on other sites

  • 7 months later...
Guest stefan

hey there!

i've got exactly the same problem as above. i can't access mysql server through mamp anymore after i have changed the root password.

i changed my password already pack to root and made sure that it is still under root in the phpmyadmin file.

but it gives me still an error msg.

 

the link above the helped 'virtual' out is death. is there another link i can follow?

 

cheers stefan

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...