Install MySQL in the tar.gz mode under Apple MacOSX

Source: Internet
Author: User
Tags gz file mysql download
On Mac systems, MySQL is usually installed with a DMG package on the graphical interface as prompted. MySQL also provides the CompressedTARArchive binary package installation method, that is, install-free and decompress the running version on the Mac system. to install MySQL Server, the DMG package is usually installed on the graphical interface as prompted. In addition, MySQL also provides the Compressed TAR Archive binary package installation method, that is, the installation-free and decompressed running version is simpler than the DMG package, and the command line-only operation is more in line with the SPOF of the coders.

System environment: OS X Yosemite 10.10.3 login user: wid (sudo permission) MySQL version: 5.6.24 (mysql-5.6.24-osx10.9-x86_64.tar.gz) MySQL Download: http://dev.mysql.com/downloads/mysql/

Find the location of the downloaded MySQL tar.gz file, which is usually in the Downloads Directory of the current user, that is,/Users/ /Downloads, enter the terminal, and decompress the tar.gz file:

cd /Users/
 
  /Downloadstar zxvf mysql-5.6.24-osx10.9-x86_64.tar.gz
 

Decompress the package to obtain the mysql-5.6.24-osx10.9-x86_64 Directory, move the unzipping directory to the default installation path of MySQL/usr/local/mysql,/usr/local path does not exist, first create sudo mkdir/usr/local.

# Move the unzipped 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 and user group cd/usr/localsudo chown-R root: wheel mysql # execute the mysql_install_db script in the scripts directory to complete some Default initialization (create a default configuration file, authorization table, etc.) cd/usr/local/mysqlsudo scripts/mysql_install_db -- user = mysql

Installation is 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

Initialize the MySQL root password

cd /usr/local/mysql/bin./mysqladmin -u root password 
 

Connect to the database through the built-in MySQL Client

cd /usr/local/mysql/bin./mysql -u root -p
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.