Go to content Go to navigation Go to search
 

MySQL under Leopard Server

Leopard Server (Mac OS 10.5) comes with MySQL 5 preinstalled and it sets it up painlessly. It allows you to set a root password and decide whether or not to allow network connections (i.e. allow connections to MySQL from other machines in your network or elsewhere). Since I’m planning to use it to share translation memory databases for the Heartsome Translation Suite within our LAN, I clearly do want to allow network connections.

However, that’s all that Leopard Server does with regard to MySQL. It would be nice if each user you created in the Workgroup under Leopard Server were given a MySQL username and password. However, it doesn’t work like that.

Moreover, out of several thousand pages of Leopard Server documentation, only 5 (yes, five) refer to MySQL. There are 3 pages in the “Web Technologies Administration” manual (Pages 92-93) and another 2 in the “Command-Line Administration” manual (pages 218-219). Although they do contain some useful information, they refer you to the MySQL manual for practically anything.

My first problem was that, though Server Admin said that MySQL was running, I could find no other evidence of that. In fact, despite having a green light on for MySQL in Server Admin, the programme listed start time as the date I did the install, not today’s date. And the logs hadn’t been updated today at all. That seemed to suggest that it wasn’t really “on” at all. (MySQL doesn’t act like an application; you don’t get an icon in the Dock like when you launch Microsoft Word, iTunes or the like).

A chat with Apple Support points me to the “Command-Line Administration” manual on the docs page. There I discover that MySQL executables are in /usr/bin/ (and elsewhere, but we don’t need to go there).

MySQL can be started and stopped using serveradmin, which is located in /usr/sbin.

So, to make sure MySQL is running, I navigate over to the /usr/sbin directory and stop it:

sudo serveradmin stop mysql

Then started it again

sudo serveradmin start mysql

It worked. Now, in Server Admin showed the new Start Time and was updating the logs.

Now, to get a closer (and more user-friendly) look, I downloaded the MySQL GUI Tools and launched MySQL Administrator. I tried to connect using “root” and the root password but get nowhere. I got such eloquent replies as “Connection Error. Could not connect to MySQL instance at 172.26.1.4. Error: Host ’172.26.1.4’ is not allowed to connect to this MySQL server (code 1130)”. Also got error code 1045. And this was me on the same machine as MySQL is installed on!

Searches on the web for those error codes reveal many frantic requests for support but no authoritative reply as to what is wrong.

After checking through the MySQL manual online, I finally try this (in the /usr/sbin directory):

mysql -u root -p

It works! The machine asks for my root password. And we’re in.

(Why this works where the MySQL Administrator failed is beyond me, since both were using “root” and the valid root password.)

Now to set up users (say “potatohead” using password “spud”). At the mysql> prompt (that semicolon at the end is vital, by the way):
grant all privileges on *.* to 'potatohead'@'*.*' identified by 'spud';
That command allows potatohead to connect the server from anywhere and do anything with MySQL. Powerful medicine indeed!

2 Comments for MySQL under Leopard Server

  1. Alex McLaren said,

    Jan 29, 03:33 pm #

    So did you get the MySQL Administrator to work in the end?

  2. John Rynne said,

    Jan 29, 04:42 pm #

    Alex,
    Yes. What I did is basically what I described above. Are you running into trouble?

Post a Comment




Textile Help