Skip to main content
Inspiring
July 16, 2006
Question

Setting up a MySQL connection on a Mac

  • July 16, 2006
  • 3 replies
  • 565 views
I have in the past set up a database app on a PC network, using IIS etc - it was a while ago, but I remember the testing folder having to be a specific folder on the PC (which I can't remember now).

I'm basically now having a look at MySQL - can anyone let me know the equivalent I need to do on a Mac for this? So stuff like the testing folder / where the localhost is, and where I should find the 'MySQL Server', 'username' and 'password' in MySQL (I've downloaded MAMP for this).

Cheers,
Iain
This topic has been closed for replies.

3 replies

Inspiring
July 17, 2006
Iain71 wrote:
> does that sound about right?

I have no experience of MAMP. Mac OS X has Apache installed by default,
and there are excellent Mac Packages for both PHP and MySQL. However, if
it works for you, that's the main thing.

> i guess the next thing to do is play around in CMSQL and figure out how to
> create queries etc - but hopefully it's not too tricky.

I have never heard of CMSQL. Most hosts offer phpMyAdmin. You would
probably be better off finding out what the host uses, and sticking with
that.

> and how to upload this lot to a host, so that it works on a live website.

As I have said before, it's very simply with phpMyAdmin Export and Import.

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/
Inspiring
July 17, 2006
MAMP is basically a Mac app that incorporates mySQL, phpMyAdmin, apache etc under one roof.

CMSQL was my shorthand for cocoaMySQL, which is a slightly more approachable, Mac styled front end than phpMyAdmin, and reminds me a bit more of FoxPro (Microsoft's older database app), in that it displays fields with drop down menus for changing their settings etc).

As of now, I've gotten as setting up a mySQL connection in DW, and creating a .php page that is working correctly on the testing server all as it should be.

From there, I've done a .sql dump from cocoaMySQL and uploaded that to my host's server. Then I created a database on my host server using phpMyAdmin in the control panel, and imported the dumped .sql file.

So now I've got the data sitting correctly on my host server's mySQL server.

Lastly, I took the connection file, edited to reflect the details for the hosted copy of the database, uploaded that, and it all seems to be working fine.

Thanks for your help - it was much appreciated.

Iain
Inspiring
July 17, 2006
i think i've got it working at last.

CMSQL connected fine using localroot:8888 - looking at it, it reminds me a lot of Foxpro that i've used in the past (although never really liked it compared to Access, but i think that's a familiarity thing as much as anything.)

also have a working database set up with a working connection.

in dreamweaver :

local info :

site name : DatabaseTest
local root folder : Macintosh HD:Users:Iain:Sites: DatabaseTest:

remote info :

access : local/network
remote folder : Macintosh HD:Applications:MAMP:htdocs: DatabaseTest:

testing server :

server model : PHP/MySQL
access : local/network
testing server folder : Macintosh HD:Applications:MAMP:htdocs: DatabaseTest:
url prefix : http://localhost:8888/DatabaseTest/

does that sound about right?

i guess the next thing to do is play around in CMSQL and figure out how to create queries etc - but hopefully it's not too tricky.

and how to upload this lot to a host, so that it works on a live website.

Iain
Inspiring
July 16, 2006
Iain71 wrote:
> I have in the past set up a database app on a PC network, using IIS etc - it
> was a while ago, but I remember the testing folder having to be a specific
> folder on the PC (which I can't remember now).
>
> I'm basically now having a look at MySQL - can anyone let me know the
> equivalent I need to do on a mac for this?

Use the Sites folder within your home folder.

--
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/
Inspiring
July 17, 2006
Isn't that where I would store the site's files - but wouldn't they go somewhere else for the testing server? An equivalent to the inetpub/wwwroot folder in windows?

When i click on connect in dreamweaver, and it brings up the dialogue box asking me for :

connection name
mySQL server
username
password
database

What do i need to put in here :

Is it

connection name : my_connection_name?
mySQL server : MySQL 5.0.19 (ie the name of the version of SQL that's running)?
username : localhost, or 127.0.0.1?
password : root?
database : my_database_name?

These were my best guesses, but just got an error about the testing server no being set up correctly?

This was using local / network, but i haven't tried it with my hosting account - would it be fine with this if i set that all up as the testing / remote server with FTP, and my host's account details?

When i upload the site, would it simply upload the database too?

I'm sure all of this stuff is fairly simple - once you know exactly what goes where!

Iain