MySQL startup off

Source: Internet
Author: User

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

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.