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.