to start the MySQL server, and
sudo /usr/local/mysql/support-files/mysql.server stopto stop it.
Third, if you installed the
MySQLStartupItem.pkg file during the installation process,
you can start the server from
the command line by calling sudo /Library/StartupItems/MySQLCOM/MySQLCOM startand stop it by calling
sudo /Library/StartupItems/MySQLCOM/MySQLCOM startFinally, you can use the generic mysqld_safe and mysqladmin programs from the command prompt. To start the server to run under the system mysql user account, type
sudo /usr/local/mysql/bin/mysqld_safe --user=mysqlThen, press
the Ctrl-Z key combination, and type
bgto leave the server running in the background.
You can then stop the server by running the command
/usr/local/mysql/bin/mysqladmin --user=root \ --password=the_mysql_root_password shutdownThis approach is the most robust, and also the most flexible if you need to add custom options to your server.
The first thing you should do once you’ve started the server is to set a password for the database root account
sudo /usr/local/mysql/bin/mysqladmin --user=root password \the_new_mysql_root_passwordOnce you’ve
set the MySQL root password, you’ll need to use this in all further accesses to the server. For example, to shutdown the server using mysqladmin
,
you would type /usr/local/mysql/bin/mysqladmin --user=root \ --password=the_mysql_root_password shutdownInstalling Only MySQL Using the no-installer Package from MySQL ABFollowing the instructions in Downloading MySQL
from the MySQL AB Web Site,”
earlier in this chapter, visit the MySQL AB downloads page and download the Without installer package corresponding to the version of your operating system and processor type.
This will download a compressed package with a name like
mysql-standard-5.0.22-osx10.4-i686.tar.gz. This is normally automatically decompressed and unpacked by the web browser
to leave the directory mysql-standard-5.0.22-osx10.4-i686 in the download directory. You may instead find that your browser decompresses the file but does not unpack it. If this is the case, you’ll find the file
mysql-standard-5.0.22-osx10.4-Share with your friends: