On mac, how can I use a terminal to open MySQL and xamppmysql that comes with XAMPP?

Source: Internet
Author: User

On mac, how can I use a terminal to open MySQL and xamppmysql that comes with XAMPP?

Start directly and describe the possible errors in each step.

1. Install xampp, open the terminal, and enter:

mysql -u root -p

It's a good luck to enter and wipe it. You don't need to read it later.

2. If the prompt "command not found" is displayed, continue the input and execution on the terminal:

ln -s /applications/xampp/bin/mysql /usr/bin

Note: Do not write usr as user!

If the execution is successful, return to step 1!

3. If the operation fails, operation not permitted is returned, indicating that there is no permission. In this case, modify the mysql permission under bin to read and write (how to modify self-search)

4. After the change, execute Step 1 again. If the problem persists, use the root user to perform step 2, that is:

sudo ln -s /applications/xampp/bin/mysql /usr/bin

5. If the problem persists, why? It took a long time to find the cause and finally found out that mac OS uses Rootlees, which can be understood as kernel protection for a higher level system,

The/usr/bin operation is locked and can only be performed with an APPLE certificate.

What should we do?

6. Method: restart the computer and press and hold

command+r

Go to restore partition, and find the terminal to start running in the utility bar.

7. Input

csrutil disable

Disable Protection

Enter

reboot

Restart your computer, or click restart.

8. restart the computer, open the terminal, and execute the Step 4 command to introduce the absolute position of the tool to/usr/bin.

9. At this time, you can open step 1.

10. Finally, for the sake of security, let's start Rootless. The method is the same as step 1 and Step 2. Execute the command.

csrutil enable

Restart the computer and then OK.

11. Restart your computer. Remember to start the mysql service of xampp first. Otherwise, an error will be reported.

can't connect to local MySQL server...

12. The end!

The above section describes how to use any terminal on mac to open MySQL that comes with XAMPP. I hope it will help you.

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.