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.4MySQL version: Mysql-5.6.26-osx10.9-x86_64.tar.gzmysql Download:/http dev.mysql.com/downloads/mysql/
Find the downloaded MySQL tar.gz file location, typically in the current user's Downloads directory, into the terminal.
Unzip the tar.gz file:
CD
CD Download
tar zxvf mysql-5.6.26-osx10.9-x86_64.tar.gz
Move folder location and configuration
Unzip the finished folder, move the folder to /usr/local
Path, if not present, first sudo mkdir/usr/local
created.
# move unpacked binary package to installation directory sudo mv mysql-5.6.26-osx10.9-x86_64/usr/local/
cd/usr/local
sudo mv mysql-5.6.26-osx10.9-x86_64 MySQL #修改文件名
sudo chown-r root:wheel MySQL # here Note: Change root to your current user name. Otherwise, you cannot start the service # perform some default initialization (create default configuration file, authorization table, etc.) Cd/usr/local/mysqlsudo the mysql_install_db script under the scripts directory 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>
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Install mysql5.6.26 on Mac OS 10.10.4