05.01.2013 Views

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 22-7. The MySQL pane in System Preferences<br />

By default, MySQL sets up a root user with full access and no password. In other words,<br />

until you do something about it, your MySQL installation is completely unsecured. The first<br />

thing to do after starting the server is to lock down that root account. The easiest way to do this<br />

is with the MySQL command-line admin tool:<br />

/usr/local/mysql/bin/mysqladmin -u root password "newpwd"<br />

where newpwd is your new password.<br />

NOTE Aside from the root user, there are also two anonymous accounts with unsecured root<br />

access. However, these accounts can only access databases whose names start with test_, and<br />

only from the localhost, so they are not much of a risk. Still, if you are actually planning on<br />

serving pages professionally, you should lock or remove these accounts. See the online MySQL<br />

manual for more details.<br />

Once it’s installed, the default MySQL client program can be invoked from the command<br />

line, like so:<br />

/usr/local/mysql/bin/mysql -u root -p<br />

CHAPTER 22 LEOPARD AS A WEB SERVER 395<br />

The -p flag will cause MySQL to prompt you for your password. Once you enter it, the<br />

command-line client program will launch. Type help to get a list of available commands, and<br />

type quit to exit.<br />

MySQL also makes a set of graphical administrative tools that can be downloaded and<br />

installed separately, as shown in Figure 22-8. The graphical package contains a manager, a query<br />

tool, and a Dashboard widget for monitoring the health of your database. If you love commandline<br />

database management, more power to you. For the rest of us, the GUI is a really nice<br />

addition.<br />

TIP To connect to your local machine’s MySQL server in the graphical administrator, use the<br />

host name localhost.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!