Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Keith Knipling

macrumors newbie
Original poster
Oct 27, 2006
11
0
I am new to MySQL and PHP. Trying to set up a local Wordpress site and manage it. Cannot connect to the MAMP MySQL database with CocoaMySQL. I am using the beta version, which works with versions MySQL > 4.1.

Thanks!

Keith
 

frankblundt

macrumors 65816
Sep 19, 2005
1,271
0
South of the border
I'm pretty sure I've used CocoaMySQL with MySQL 5. PhpMyAdmin is your other choice, which comes with MAMP and which gives you more controls over stuff like setting users and so on, but the interface isn't as pleasant.

For CocoaMySQL you need to know the root password for MySQL for the utility to be able to connect to it (and MySQL needs to be running), so that you can enter Host: localhost , User: root, Password: <password> in the connection dialog.

I believe for MAMP the root password is set to "root" by default,

.. which you should change (using phpMyAdmin > Privileges > change password for root@localhost), although this may mean that MAMP can no longer connect to it, without altering some conf files :eek:
 

Keith Knipling

macrumors newbie
Original poster
Oct 27, 2006
11
0
Here is a screenshot from phpMyAdmin, which says

"MySQL 5.0.19 running on localhost as root@localhost"

In CocoaMySQL I am trying to connect using localhost | user:root: password: root.

Thoughts?
 

Attachments

  • Picture 2.png
    Picture 2.png
    34.5 KB · Views: 330

frankblundt

macrumors 65816
Sep 19, 2005
1,271
0
South of the border
You should be able to change the root password from within PhpMyadmin (under the privileges section) to whatever you like. I just can't recall whether MAMP is smart enough to update itself when that happens to still have access to the MAMP database, but hopefully :p

When you've set the root password you should be able to use that to connect via CocoaMySQL
 

ddekker

macrumors regular
Sep 23, 2006
222
0
Michigan
wordpress

I found when I first started playing with MAMP servers and wordpress It went okay besides when I set the root password...lol... I just had the database named 'wordpress' and the password as '' (it was blank) and all was fine, I later in life figured out the whole root password and things... surely get phpmyadmin installed and working, I also found that you should get it going.. figure out how to change the mysql root password, I also placed PHPmyadmin in a directory with a .htaccess file so no one can get to it without another password, with no root password anyone can get in and screw with your SQL databases.... on the lighter side to it, once you get it going its a riot to play with (all the plugins and things).. I have my blog running on it, and a half dozen other sites just to help me learn..

good luck

DD
 

Keith Knipling

macrumors newbie
Original poster
Oct 27, 2006
11
0
By default, MAMP does password protect MySQL. The default username is:
User: root
Password: root
for the localhost.

One can change this, but it involves changing other config files (I tried changing the database in phpMyAdmin, but then messed things up so MAMP could no longer communicate with the database. Ended up reinstalling MAMP).

I would think CocoaMySQL should connect to the MAMP database using root and root as user and password, respectively. The MAMP database is password protected by default.

Is the problem with the host? Is localhost correct? I tried "localhost" and "localhost:8888"

Thanks.
 

ddekker

macrumors regular
Sep 23, 2006
222
0
Michigan
localhost is fine, sometimes you will see an internal ip (127.0.0.1) but either is fine... as far as being secure with "root" "root" I would sure try and get stronger sercurity than that.. trust me, i'm no sercurity expert...lol.. far from, I just found it amazing how many sites by browsing around I could get into their phpmyadmin area.. reminds me of seeing wireless access points named "linksys"..lol... no one ever changes their password...


DD
 

Keith Knipling

macrumors newbie
Original poster
Oct 27, 2006
11
0
But that is the problem. The "local host" used by MAMP is not localhost. If I type "localhost" in the browser window it points to my local Apache server set up in OS X.

MAMP, by design, has a bundled Apache server that points to "localhost:8888." I want to access this to CocoaMySQL, but cannot seem to.

I don't really care too much about the password issue, as I do not intend to let this see the Internet "light of day." Can anyone outside have easy access to the MAMP server anyway? The original intent of MAMP was as a local development server, not as a real server.
 

frankblundt

macrumors 65816
Sep 19, 2005
1,271
0
South of the border
Either change the default port in MAMP to 3306 (for MySQL) and access MAMP's MySQL thru CocoaMySQL using the default localhost with the port field blank (it defaults to 3306 anyway)

or set the port in CocoaMySQL to whatever the port is that MAMP sets for it (along with localhost, root, root)

I forget whether the port setting is in Preferences or one of the tabs in the control panel in MAMP, but it's there somewhere.

If you want to access the MAMP Apache through localhost (without adding the port), you'll need to set that to 80 in MAMP also (which won't work if you have Personal Web Sharing - OSX Apache - checked in Sys Prefs > Sharing)

Still no go?
 

Keith Knipling

macrumors newbie
Original poster
Oct 27, 2006
11
0
I tried both suggestions

1. Using the dafault port in CocoaMySQL, and changing MAMP.
2. Changing CocoaMySQL to port 8889, the default in MAMP.

Attached are screenshots from the latter attempt. Still no luck - MySQL says it can't connect.
 

Attachments

  • Picture 1.png
    Picture 1.png
    48.2 KB · Views: 143
  • Picture 2.png
    Picture 2.png
    29.1 KB · Views: 138

frankblundt

macrumors 65816
Sep 19, 2005
1,271
0
South of the border
mysterious.
it shouldn't affect anything, but do you have Firewall running?
Do you have any other installations of MySQL running?
MAMP itself is running fine? - the MySQL server starts up without issues and you can open the default MAMP page in Safari?
Can you connect via PHPMyAdmin? What does it show on the main page?:

MySQL - x.x.xx Complete MySQL by Server Logistics
Protocol version: 10
Server: Localhost via UNIX socket
User: root@localhost

If it is working, can you go to the privileges section and change the root password to "root"?
 

Keith Knipling

macrumors newbie
Original poster
Oct 27, 2006
11
0
Here are screenshots of phpMyAdmin (off of the MAMP startup screen in Firefox).
 

Attachments

  • Picture 1.png
    Picture 1.png
    95.8 KB · Views: 181
  • Picture 2.png
    Picture 2.png
    37.4 KB · Views: 144

frankblundt

macrumors 65816
Sep 19, 2005
1,271
0
South of the border
In the Privileges section of PhpMyAdmin can you set the root password to root (just to make sure that's what it is).

It's a bit strange that there are no databases listed to browse, I had thought MAMP created at least one for itself and MySql two (mysql and test)

If CocoaMySQL is still not able to connect as root root to localhost on port 8889 I'd probably look at uninstalling and re-installing MAMP. Seems a bit screwy.
 

Keith Knipling

macrumors newbie
Original poster
Oct 27, 2006
11
0
Here is the error from CocoaMySQL. I also took a screenshot from the phpMyAdmin panel. There are databases.
 

Attachments

  • Picture 4.png
    Picture 4.png
    35.3 KB · Views: 123
  • Picture 3.png
    Picture 3.png
    41.1 KB · Views: 142

7kire

macrumors newbie
Jul 21, 2007
1
0
I believe for MAMP the root password is set to "root" by default,

.. which you should change (using phpMyAdmin > Privileges > change password for root@localhost), although this may mean that MAMP can no longer connect to it, without altering some conf files :eek:

These config files are:
/Applications/MAMP/bin/phpMyAdmin/config.inc.php @line 86
/Applications/MAMP/bin/mamp/index.php @line 15
 

kemitchell

macrumors newbie
Jul 24, 2007
6
0
Texas
MAMP runs a very self-contained PHP install, which by default is set to go through the socket in /Apps.../MAMP rather than the default in /tmp. This bothered me to no end when trying to use phpsh to test some scripts id written in the MAMP environment.

It is worth noting that if you have the admin password, you can run the MAMP apache and mysql servers on the default ports (check the MAMP prefs dialog).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.