Managing MySQL on Mac OS X
Pages: 1, 2, 3
Assuming you are setting it up yourself, the two files you'll definitely need to concern yourself with are at the top level of the phpMyAdmin directory: config.inc.php and Documentation.html. While I can't duplicate that information in this article, there are a handful of critical variables that need setting in the config file, which I'll touch on briefly. Read the documentation for full details.
The first one is not too far from the top of the config.inc.php file: PmaAbsoluteUri, which is just the full web address for your phpMyAdmin directory. Assuming you've renamed it to phpmyadmin and put it in your Sites folder, that line will look like this:
$cfg['PmaAbsoluteUri'] = 'http://localhost/~username/phpmyadmin/';
Farther down in the file, under the "Server(s) configuration" section:
$cfg['Servers'][$i]['host'] = 'localhost';
Substitute your MySQL server hostname where it says localhost above. Then just below that:
$cfg['Servers'][$i]['user'] = 'username';
$cfg['Servers'][$i]['password'] = 'password';
These are the username and password for your user account on the MySQL database server. Once more, these are different than your web server login information.
Once you have phpMyAdmin configured and you've confirmed you can log in, you'll want to have a scan through the online documentation to get a sense of what's available -- quite helpful if you're already familiar with MySQL and just want to see what you can and can't do. On that note, while you can't (arguably) administer things as easily as with MySQL Administrator, there are a few basic options that you might want to familiarize yourself with, so that you can do things in more than one place. I highly recommend the user privileges section for starters.
The Command Line
Loved by some, feared by others, the all-powerful command line offers some of the best options for controlling MySQL . . . if you know what you're doing. Also, if you're in a situation where your only access to your server is via SSH and a terminal, using the command line might just save the day.
Now, this might just be me, but I've actually found a lot of value in using this option as a training tool for new users. By showing them the literal grammar of what's going on -- SELECT name FROM USERS WHERE hat = 'Stetson' -- gives them both a sense of what's really being done, and a foundational vocabulary when they turn around and use other programs, whether GUI or web-based.
You can get started with the command line by checking out the online documentation. I'd even recommend downloading the docs locally so you have them at the ready, for easy reference while you're learning and working.
A Note on CocoaMySQL
Another entry in the Cocoa-based GUI apps was CocoaMySQL, which I used quite a bit before switching to MySQL 4.1. Certain changes in the database security methods that came with 4.1 (explained in this FAQ) have left the application unable to connect to newer servers, although at least one forked version is reportedly available that takes care of the problem.
All of the Above
Which one should you choose? Well, it naturally depends on what kind of user you are, as well as how experienced you are -- but also on what kind of access you have to the database server in question.
All things being equal, I would obtain and learn all of the above. Each has its strengths and weaknesses, yet if you can absorb even a little of all of them, you'll both broaden your MySQL knowledge and add utilities to your toolbelt.
Robert Daeley is a writer and programmer in Southern California. By day he is a mild-mannered server administrator and website developer; by night, in addition to his super-hero duties, he cooks, bikes, hikes, cheers on the Dodgers, and writes fiction.
Return to the Mac DevCenter
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 21 of 21.
-
Migration from Windows to MAC
2007-11-13 04:08:02 the_witt [Reply | View]
Hello to all! I am new to this group.
I recently Moved from Windows to MAC.
I still use windwos machines at work, and at home. But, I Got a MAC Powerbook G4 from a friend to use for school work. I am familiar with te Windows command line and how to access MySql from there. My question is: How do I access the same area using the MAC OS X Darwin? I'm Stumped...
Can anyone help me out?
-
Getting into MySQL adminitrator
2006-03-01 23:15:17 Mystefier [Reply | View]
You mentioned the put in your host, username and password really quickly and that part seems to be a huge beast to me. I need more help on that. I keep typing different things as far as my website space and it's not excepting. I was a bit confused as well. Are they wanting me to put in my website address or do they want the main addresss to the server site I use. I can't seem to get past that first page on the program.
-
CocoaMySQL Beta Version
2006-01-29 11:13:29 lorenz.textor [Reply | View]
There is a beta version of CocoaMySQL which works with MySQL 4.1 and 5 available on http://cocoamysql.sourceforge.net/beta.php.
-
Navicat
2006-01-20 08:20:12 wallygva [Reply | View]
Let me recommend a tool I've been using for a couple of weeks and it's really good for desktop management of a remote MySQL database installation- Navicat. I switched off Windows a year or so ago and this finally has me forgetting about the old Access->ODBC connection to MySQL. This is better and has many more features.
navicat.com
-
Newbie w/Access Experience
2005-12-29 10:14:00 jodeo [Reply | View]
I've only ever used (gasp!) MS Access for databases.
Since I'm GUI-oriented, will I be able to easily build a DB using MySQL and a gui like YourSQL?
I'm open to other tools. Also, I'm still using ColdFusion rather than PHP.
Thanks!
-
SQLite
2005-12-15 05:32:01 fat-hen [Reply | View]
Are there any similar tools for managing Tiger's built-in SQLite dbm? -
SQLite
2005-12-16 02:22:10 leeg [Reply | View]
SQLite isn't the same sort of thing; it's just a library for manipulating structured data files whereas MySQL is a database management server (which includes its own library doing kindof what SQLite does). So the tools on Tiger for manipulating SQLite are /usr/bin/sqlite3 and whatever Core Data app you're about to write in Xcode; there are no 'management' tools per se. -
SQLite
2005-12-16 05:08:13 fat-hen [Reply | View]
I'm not sure what you're saying. It's all data whether it's managed by MySQL or SQLite. I'm not interested in how either or them does what it does. What I *am* interested in is managing my data. I agree that Tiger doesn't provide tools for SQLite other than the command line or Core Data, but it seems to me that there is certainly a place for a tool that allows users to manipulate SQLite databases created by the system. Things like Safari's RSS feeds and whatever Aperture does.
> there are no 'management' tools per se.
There is, in fact, SQLite Manager:
http://www.sqlabs.net/sqlitemanager.php
-
MAMP? I prefer XAMP
2005-12-14 11:55:29 Vanish [Reply | View]
I see someone else already mentioned the official MySQL Browser. Be forewarned, however, it is more than a little buggy for OS X. Not all features have been implemented yet either.
Another tool I believe worth mentioning is Aqua Data Studio. It is free (non-commercial), built in Java (but thankfully not too noticable) and allows multiple connections from MySQL and PostgreSQl to Oracle and MS SQL. I am a DBA by trade and this tool has replaced nearly all others I've used for maintaining and working with my various disparate databases day to day.
Oh, and MAMP? I've never liked the acronym and I suspect many others do not as well. I've always prefered XAMP. (Yes I know someone released an installation package called XAMP, but the acronym existed before that)
-
dbVis free edition
2005-12-14 09:49:55 Paul_Furbacher [Reply | View]
You might think about adding Minq software's dbVis free edition (http://www.dbvis.com/products/dbvis/info.html) offers a lot of features needed by the average developer who needs to run queries and so on against any database, not just MySQL. Since it's written in Java, it runs on just about every OS, including OS X. And if you need all the features of the Personal edition, you can hardly beat the $99 price tag.
<br/>
Also, I find it odd that the article did not mention MySQL's QueryBrowser (did I read the article too fast?). It is a great tool: I've used it mainly on Windows boxes for interacting with data.
<br/>
(I'm not sure why I'd want to have to set up and manage PHP just to interact with my data with the phpMyAdmin solution mentioned in the article, especially if I'm a Java developer. I like to do as little work as possible on the ancillary issues in these kinds of things, and spend as much as possible on that which actually puts bread on the table. Hence, setting up PHP just to do Web-based admin -- do we really have time to waste waiting for Web pages to refresh? -- would not even be a consideration around here, especially since you can use MySQL's tools over across a network.)
<br/>
Finally, one more tool deserves mention is MySQL's Migration Toolkit which quite unfortunately is not available for OS X. I was desperate to migrate a database from Oracle to something/anything else, and the Migration Toolkit worked beautifully with the Oracle database that had nearly 200 tables and lots of data. Within an hour, I had successfully migrated the entire Web application that used this database. All I needed to do with the Web app was to change the datasource definition to point to the MySQL database. Hopefully, MySQL.com will get enough requests from OS X developers/DBAs to also offer the Migration Toolkit for OS X.
-
Similar tools for PostgreSQL
2005-12-14 09:02:40 brocklee [Reply | View]
Does anyone have a comparable list of OS X tools for PostgreSQL that they'd share?
-
MAMP?
2005-12-14 04:51:32 leeg [Reply | View]
I think you mean DAMP - Darwin, Apache, MySQL, Perl. The "WebObjects" is silent :-) -
MAMP?
2005-12-14 08:57:25 Robert Daeley |
[Reply | View]
Ha! And "DAMP" does fit in with the MySQL dolphin logo, does it not? ;)
-
MySQL Query Browser
2005-12-14 04:07:49 malcolmrigg [Reply | View]
Something you didn't mention in your article is that the official MySQL Query Browser app is now available for Mac OS X - this is well worth a look as it has loads of useful features. -
MySQL Query Browser
2005-12-14 08:59:35 Robert Daeley |
[Reply | View]
Ah, excellent, thanks. I wasn't aware that was available for Mac.
http://www.mysql.com/products/tools/query-browser/
I'll see about including that in a future article.
-
The forked version of CocoaMySQL
2005-12-14 02:29:22 PhilipTrauring [Reply | View]
You can find the forked version of CocoaMySQL here:
http://www.theonline.org/cocoamysql/
-
CocoaMySQL
2005-12-13 21:14:19 LubTex [Reply | View]
Another great GUI for day to day table manipulation and query execution is CocoaMySQL http://cocoamysql.sourceforge.net/. I have found it very handy in even learning MySQL since it can give you a Console view to see the executed commands from the GUI. I have found it indispensible as a web developer. -
CocoaMySQL
2005-12-14 13:48:17 filipp [Reply | View]
CocoaMySQL is the tool I keep coming back to, nice that the original author mentioned it as well. I run MySQL 4.0.21 and the official MySQL Administrator (1.1.0) is not able to create views which unfortunately renders the app pretty useless for me, otherwise it's pretty sweet and makes certain tasks much easier than CocoaMySQL. With a modern version of MySQL server, I'd probably recommend this version too (for what it's worth... :))






This new app looks great, the new developers have cleaned up the interface to make it look more at home on Mac OS X 10.5 - and it runs extremely quickly on my 2.6Ghz MacBook Pro.
It doesn't look like any significant new features have been added, but it does seem more stable. I would recommend it to anyone working with MySQL databases on Mac OS X.