Start and Stop MySql under Mac

Source: Internet
Author: User
Mac # MySql # methods of starting and stopping services 1. Using the dig Command Line Method to start with mysqld, pay attention to parameter settings. In addition, you can view the configuration in the etcmy. cnf file, in mysql

Mac # MySql # Start and Stop Services 1. sudo/Library/StartupItems/MySQLCOM start 2. sudo/Library/StartupItems/MySQLCOM stop command line is started using mysqld. Pay attention to parameter settings. In addition, you can view/etc/my. cnf file configuration, in mysql

Mac # MySql #Start,Stop

Service Method

1. sudo/Library/StartupItems/MySQLCOM start

2. sudo/Library/StartupItems/MySQLCOM stop

Command Line

MysqldStart, Pay attention to the configuration parameter settings. In addition, you can view the configuration in the/etc/my. cnf file, in mysqlStartThe file configuration is loaded.

Start

Pay special attention to the -- user parameter

Sudo/usr/local/mysql/bin/mysqld -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data -- plugin-dir =/usr/local /mysql/lib/plugin -- user = mysql -- log-error =/usr/local/mysql/data/2014-443deMacBook-Pro.local.err -- pid-file =/usr/local/mysql/data/2014-443deMacBook-Pro.local.pid -- socket =/tmp/mysql. sock -- port = 3306 &

Stop

Sudo/usr/local/mysql/bin/mysqladmin-uroot-p123456 shutdown

Alias

Define the short form of commands in the user environment configuration file, eliminating the need to enter the long string command path.

Summary

Sometimes for various reasons, MySql does notStart, It is often reported that/tmp/mysql. sock cannot be found, the cause of this problem is mysqlStartThis file will be created elsewhere. This is usually encountered after mysql is installed in the initial stage. If this error is reported later, it indicates that mysql does notStartThis file is not created at all.

To analyze the problem, run the following command:

1. ps-ef | grep mysql

2. kill3213

3. Try againStartAnd run the ps-ef | grep mysql command to view the process status.

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.