|
under Mac OS X |
|||||||||||
Installing
and Setting Up MySQL |
These directions describe how to install and setup MySQL under Mac OS X. There are a few pecularities of Mac OS X which require some additional installation steps. This tutorial assumes you are running Mac OS X 10.2 (Jaguar) or later. 1. Open a Terminal Window. 2. Enter the following commands (followed by return on your keyboard): (or just cut from edit box and paste into your Terminal Window)
3. Change directory to /usr/local. This is where we are going to download the desired MySQL binary. 4. FTP to a site where you can download the latest stable version of MySQL. It is easiest if you download and install a precompiled binary, which is normally available at all mirror sites. To FTP from a command line, pick a server, then connect via the ftp command. Examples:
Once logged in you will need to use the "cd" command to change directories. For Univeristy of
Wisconsin: You can then use the "ls" command to list all the files in the directory. Use the copy function to copy the name of the latest MySQL file you want to install (example: mysql-3.23.53-apple-darwin6.1-powerpc.tar.gz) and then paste into the :get" command, example: You should see the ftp process begin. Once completed, click "control-D:" to terminate the FTP session and return to the command prompt. Type "ls" to see that the archive was indeed downloaded to your /usr/local directory. 5. You must now gunzip the downloaded package then untar it. Example: 6. create a symbolic link: 7. Create the MySQL tables by running the mysql_install_db script: 8. Change the ownership of directories and groups: 9. Move into the mysql directory: 10. Start the MySQL daemon with: 11. Add the /usr/local/mysql/bin path to your default shell PATH variables: Now close this Terminal window, and open a new one. This will invoke the newly set PATH in your shell. This way you can directly enter mysqladmin commands without having to type the entire path. 12. See that the mysql daemon is running and your path variable is correctly set by entering: You should see the server version displayed with additional details. 13. Set root password for MySQL: Should you need to change the root password at some later time, use: mysqladmin -u root -p password new_password You will be prompted to enter the existing (old) MySQL root password. 14. Finally, if you wish to have the MySQL daemon start automatically upon restart, you should enter the following commands: At this time you should restart your machine to see that the mysql daemon has automatically restarted and that you can connect to it using the mysqladmin version command (through a Terminal window).
|