Install MySQL under Mac

Source: Internet
Author: User

Mac installation software is basically an operation:

First download the software, then double-click Install installation software, and finally add the path, the MySQL installation process is the same:

: https://dev.mysql.com/downloads/mysql/

I downloaded the mysql5.6 version, then the installation, the installation path is the/usr/local directory, Linux under the user's own installation of the software is basically in this directory, and then add the path, this is the path to run the MySQL command, to find out.

The executable program is usually located in the bin directory of the installation path of the software, in MySQL, for example, there are many executable programs under/usr/local/mysql/bin/, including Mysql,mysqld,mysqldump.

Using the VI Editor to open ~/.bash_profile

Add the following content:

Path= $PATH:/usr/local/mysql/bin

  

Then, after saving, execute the following command on the shell command line:

SOURCE ~/.bash_profile

  

All commands under/usr/local/mysql/bin can then be used directly under any path, such as logging in to MySQL and using the following command directly:

Mysql-uroot

  

If you do not add a path, you can also execute the MySQL command, this is the basis for the design of Linux, here is no longer a statement, if you are in your home directory, you can start MySQL by command

/usr/local/mysql/bin/mysql-uroot

  

The default MySQL password is empty, after entering MySQL, it must be after entering MySQL , execute the following command to change the password for the root user of MySQL:

Set password for ' root ' @ ' localhost ' =password (' 123456 ')

The above command is for the root user to set a password of 123456, you can use the following command to log in

mysql-uroot-p123456

  

Install MySQL under Mac

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.