Specifications
Chapter 13 Configuring and Managing Web Technologies 219
To set/change the root password:
$ sudo /usr/sbin/serveradmin stop mysql
$ sudo /usr/sbin/serveradmin settings mysql:rootPassword = password
$ sudo /usr/sbin/serveradmin start mysql
When you set up MySQL service, set up a password for the MySQL root user to protect
your server from unauthorized access.
To change the database location:
$ sudo /usr/sbin/serveradmin stop mysql
$ sudo /usr/sbin/serveradmin settings mysql:databaseLocation = /path/to/new/
database/
$ sudo /usr/sbin/serveradmin start mysql
MySQL is preconfigured to use /var/mysql/ as the default database location.
By default, changing the database location creates a database at the chosen path if one
does not exist at that location.
To move a database to a new location:
$ sudo /usr/sbin/serveradmin stop mysql
$ sudo cp -Rp /oldpath/mysql /newpath/
$ sudo /usr/sbin/serveradmin settings mysql:databaseLocation = /newpath/
mysql
$ sudo /usr/sbin/serveradmin start mysql
To set the network option:
$ sudo /usr/sbin/serveradmin stop mysql
$ sudo /usr/sbin/serveradmin settings mysql:allowNetwork = yes
or
$ sudo /usr/sbin/serveradmin settings mysql:allowNetwork = no
$ sudo /usr/sbin/serveradmin start mysql
To start mysqld:
$ sudo /usr/sbin/serveradmin start mysql
The following are useful tools distributed with MySQL. Each has its own man page:
 mysql_install_db—Installs the default MySQL database.
 mysqladmin—Administers the MySQL database.
 mysql—The MySQL database text-based client.
mysqld_safe, the mysqld parent (watchdog) process used in previous releases
of Mac OS X Server, is not used in v10.5. Its function has been replaced with
/usr/bin/launchd.
Do not use mysqld_safe to start mysqld. It interferes with the operation of launchd.
For more information about setting up and configuring MySQL, see www.mysql.org.