Some MySQL operations under the Mac

Source: Internet
Author: User

#一, enter MySQL from the terminal

is different from MySQL under Windows. The MySQL installation path under Mac is different, so the operation will be slightly different;

The following actions are premised on installing MySQL by default.

# #一 (1): After you open the terminal, set the path, and then do not specify the path after each step (case sensitivity):

Input:

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

Enter confirm;

Re-enter: mysql-uroot-p; (starting from the same operation as the Windows edition)

Enter the MySQL password to confirm, if the password is correct, you can go to MySQL, you will see the following information roughly:

Welcome to the MySQL Monitor.  Commands End With; or \g.your MySQL connection ID is 4Server version:5.7.11 mysql Community Server (GPL)

# #一 (2): If you omit the first step of the set path operation. So the next step is to take the path. Like what:

Mysql-uroot-p to write

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

#二, modify MySQL port number

The My.ini,mac modified port number differs from windows in:

/library/launchdaemons/com.oracle.oss.mysql.mysqld.plist file,

The file to be opened with terminal, Terminal input command: open/library/launchdaemons/com.oracle.oss.mysql.mysqld.plist

After opening the file, locate the <string>--port=3307</string> under the <array> field, change the following 3307 to your port number, and if you cannot find it, add it yourself and save the exit.

Note: Stop MySQL in System Preferences before modifying and then turn on the MySQL service.

Some MySQL operations under the 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.