MySQL Universal Installation:

Source: Internet
Author: User

To create a MySQL group and users:

-r-g mysql-s/bin/false MySQL


To create a related directory:

mkdir -p/data/mysql/mysql3306/{data,logs,tmp}chown -R mysql.mysql/data/mysql

Initialize MySQL:

LN -s/opt/mysql-5.7. -LINUX-GLIBC2. -x86_64//usr/local/mysqlchown -R mysql.mysql/opt/mysql-5.7. -LINUX-GLIBC2. x86_64chown -R mysql.mysql/usr/local/MySQL/usr/local/mysql/bin/mysqld --defaults-File

To find the root password:

Cat /data/mysql/mysql3306/data/error.log | grep Password

Start MySQL:

/usr/local/mysql/bin/mysqld--defaults-file=/data/mysql/mysql3306/my3306.cnf &

Log in to MySQL:

To modify the root password, delete the dangerous account:

' Password ' ;d elete from mysql.user where user! ='root' or host!='localhost ' ; flush privileges;

Turn off MySQL:

Mysqladmin-s/tmp/mysql3306.sock-p shutdown

Add MySQL PATH:

Vim/etc/profile.d/mysql. SH export PATH= $PATH:/usr/local/mysql/bin

Multi-instance:
Create the 3307 required directories:

mkdir -p/data/mysql/mysql3307/{data,logs,tmp}

Initialization 3307:

/usr/local/mysql/bin/mysqld--defaults-File

To find the 3307 root password:

Cat /data/mysql/mysql3307/data/error.log | grep Password

Start 3307:

/usr/local/mysql/bin/mysqld--defaults-file=/data/mysql/mysql3307/my3307.cnf &

Login 3307:

Close 3307:

Mysqladmin-s/tmp/mysql3307.sock-p shutdown

MySQL Universal Installation:

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.