MySQL startup off
1. Start
Method One:
/usr/local/mysql/bin/mysqld--defaults-file=/data/3306/my.cnf--user=root 2>/dev/null & log Direct output with learning terminal
Method Two:
/bin/sh/usr/local/mysql/bin/mysqld_safe--defaults-file=/data/3306/my.cnf--user=mysql 2>&1 >/dev/null & Log output To log file multiple instances
Method Three:
Cp-v/usr/local/mysql/support-files/mysql.server/etc/init.d/
Chkconfig--add Mysql.server
Start MySQL server: Service mysql.server {Start|stop|restart|reload|force-reload|status} single node applies
2. Close
Method One:
/usr/local/mysql/bin/mysqladmin-uroot-p123456-s/data/3306/mysql.sock shutdown Multi-instance
Method Two:
Service MySQL Stop
Method Three:
PS aux|grep mysql|grep-v Grep|awk ' {print $} ' |xargs KILL-USR2
3. Connection
Local/usr/local/mysql/bin/mysql-uroot-p123456-s/data/3306/mysql.sock
Remote/usr/local/mysql/bin/mysql-uroot-p123456-h 127.0.0.1-p3306
4. Change the password
In case of no password
1> with Set password command
Mysql-uroot
mysql> SET PASSWORD = PASSWORD (' 123456 ');
To set the root user to have remote access, perform
Mysql> GRANT All privileges on * * to ' root ' @ ' 192.168.% ' identified by ' 123456 ' with GRANT OPTION;
2> with Mysqladmin
mysqladmin-u root Password "123456"
3> editing the user table directly with update
Mysql-u Root
mysql> use MySQL;
mysql> UPDATE user SET Password = Password (' newpass ') WHERE user = ' root ';
mysql> FLUSH privileges;
Modify with Password
Mysqladmin-u root-p ' 123456 ' password ' 123456789 '
Mysqladmin-u root-p ' 123456 ' password ' 123456789 '-s/data/3306/mysql.sock
Forgot password processing
Pkill MySQL
Mysqld_safe--skip-grant-tables&
Mysql-u Root MySQL
mysql> UPDATE user SET Password=password ("123456") WHERE user= ' root ';
mysql> FLUSH privileges;
Must be in the where condition, must be added password cryptographic function
MySQL startup off