Install MySQL on Mac OS X

Source: Internet
Author: User
Tags install mac os x

Download the dmgformat installation file from the MySQL website http://mysql.com/downloads/mysql. 64-bit (x86, 64-bit) is recommended ).

Open the installation package. The first file with the extension of PKG is the installation file. MySQL does not need to be compiled and installed, just run PKG to install it. Install Mac OS X PKG of MySQL to/usr/local/MySQL-version, and generate a symbolic connection,/usr/local/MySQL, pointing to a new location. If the/usr/local/MySQL directory exists, first change it to/usr/local/MySQL. Bak. After installation, the installer automatically runs mysql_install_db to create an authorization table in the MySQL database.

After the installation is complete, double-click the mysql. prefpane file to add a MySQL Management Panel to the system settings. You can enable and disable MySql in system preference settings.

If mysql. prefpane is installed, a new "MySQL" item is displayed when you enable system preference settings. Start and Stop the MySQL service. At the same time, we can see that there is a single "automatically start MySQL server on startup" below, that is, whether to start the MySQL service with the system boot. If you select it, the following mysqlstartupitem. PKG does not need to be installed.

What is the file mysqlstartupitem. PKG? It provides the function of starting MySQL with the MAC system. How can I cancel starting with the system? Just now, just remove random start.

Read the readme.txt file carefully and you will find that you can create two alias instances for MySQL and mysqladmin. In this way, you do not have to enter the full path to execute MySQL and mysqladmin.

Run in the terminal:

12 alias

mysql=
/usr/local/mysql/bin/mysqlalias

mysqladmin=
/usr/local/mysql/bin/mysqladmin

The newly installed MySQL has no password. You can use the following command to create a password for the root user. For example, we set the initial password to 123456 for the root user of MySQL.

1 /usr/local/mysql/bin/mysqladmin

-u root password 123456

In addition to enabling and disabling MySQL on the control panel, you can also use the terminal command line to control startup, stop, and restart:

sudo /Library/StartupItems/MySQLCOM/MySQLCOM [start|stop|restart]

OK. installation is complete.

Related Article

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.