Apple Mac OS X Server Network Card User Manual


 
216 Chapter 13 Working with Web Technologies
To set the root password:
$ sudo /usr/bin/mysqladmin shutdown
$ sudo /usr/bin/mysqld_safe --skip-grant-tables --skip-networking &
$ sudo /usr/bin/mysqladmin -u root flush-privileges
password
new-password
When you set up MySQL service for the first time, make sure to set up a password for
the MySQL root user to protect your server from unauthorized access.
To create a database:
$ mysqladmin -u root password "
password
"
> create database mydatabase
To set the network option:
Edit /etc/mysqlManager.plist and set the string value of the
allowNetwork key to either
"yes" or "no".
To start mysqld:
1 Edit /etc/hostconfig and set MySQL to -YES-.
2 Start mysqld.
$ SystemStarter start MySQL
To stop mysqld (and clear flag in /etc/hostconfig so it does not start upon reboot):
1 Edit /etc/hostconfig and set MySQL to -NO-.
2 Stop mysqld.
$ sudo SystemStarter stop MySQL
The MySQL startup item launches the mysqld daemon with arguments extracted from
the configuration file /etc/mysqlManager.plist. It uses the Apple-provided
mysqld_manager_options tool to do this.
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
 mysqld_safe—The mysqld parent (watchdog) process
 mysql—The MySQL database text-based client
For more information about setting up and configuring MySQL, see www.mysql.org.