On the MAC system, install MySQL Server is usually with DMG package in the graphical interface under the prompt installation, in addition to MySQL also provides the compressed TAR Archive binary Package installation mode, that is, free installation decompression run version, compared to the DMG package, free installation Version of the process is more concise, pure command-line operation, more in line with the code guests Toss spirit.
System environment: OS X Yosemite 10.10.3 Login User: wid (with sudo permission) MySQL version: 5.6.24 (mysql-5.6.24-osx10.9-x86_64.tar.gz) mysql Download: http://dev.m ysql.com/downloads/mysql/
Find the downloaded MySQL tar.gz file location, the browser download general in the current user's Downloads directory, that is/users/<yourname>/downloads, into the terminal, unzip tar.gz file:
Cd/users/<yourname>/downloadstar ZXVF mysql-5.6.24-osx10.9-x86_64.tar.gz
After extracting the mysql-5.6.24-osx10.9-x86_64 directory, move the extracted directory to the MySQL default installation path/usr/local/mysql,/usr/local path does not exist, first sudo mkdir/usr/loca L Create.
# Move the unpacked binary package to the installation directory sudo mv mysql-5.6.24-osx10.9-x86_64/usr/local/mysql# change the MySQL installation directory to the user group Cd/usr/localsudo chown-r ro Ot:wheel mysql# Perform some default initialization (create default profile, authorization table, etc.) by executing mysql_install_db script in scripts directory Cd/usr/local/mysqlsudo Scripts/mysql_ install_db--user=mysql
Installation complete, test start, restart and stop:
cd/usr/local/mysql# start sudo support-files/mysql.server start# restart sudo support-files/mysql.server restart# stop sudo Support-files/mysql.server stop
Initializing the MySQL root password
Cd/usr/local/mysql/bin./mysqladmin-u Root Password <your-password>
Connect to the database via your own MySQL Client
Cd/usr/local/mysql/bin./mysql-u root-p<your-password>