Install mysql-5.7.10 multiple instances on Mac

Source: Internet
Author: User

Mysql-5.7.10-osx10.10-x86_64

Mac small test sledgehammer, install a MySQL to play

Default installation to Directory/usr/local

Dsmemberutil checkmembership-u mysql-g MySQL

Cd/usr/local
Ln-s mysql-5.6.27-linux-glibc2.5-x86_64 MySQL
CD MySQL

# Add Mysql/bin to the environment variable, which is the/ETC/BASHRC file

Cat "Export path= $PATH:/usr/local/mysql/bin" >>/ETC/BASHRC

# Add the default configuration file
My_print_defaults command to see

Default options is read from the following files in the given order:
/ETC/MY.CNF/ETC/MYSQL/MY.CNF/USR/LOCAL/MYSQL/ETC/MY.CNF ~/.my.cnf

# I'll put my.cnf in/etc/my.cnf

# Initialize data file

Mysqld--initialize--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/mysql3306

Mysql_ssl_rsa_setup

# There will be a final

2015-12-16t12:12:43.106693z 1 [Note] A temporary password is generated for [email protected]: T:NRZH/_3CPA

The last one is the initial password, get rid of him.

Mysqladmin-u root password ' root '-p

Enter your password: T:NRZH/_3CPA

# Change Password before starting

# Otherwise specify the configuration file when executing

Mysqld_multi--DEFAULTS-EXTRA-FILE=/USR/LOCAL/MYSQL/MY.CNF Report
# or
Mysqld_multi--DEFAULTS-FILE=/USR/LOCAL/MYSQL/MY.CNF Report
# or
Mysqld_multi Report

# view
Mysqld_multi Report

# start
Mysqld_multi Start 3306

# stop
Mysqld_multi Stop 3306--password=root
#or better use this.
Mysqladmin-s/tmp/mysql_3306.sock-uroot-p shutdown

# Create an authorized new user and start using

GRANT all privileges the test.* to ' hive_user ' @ ' percent ' identified by ' Hive_user ' with GRANT OPTION;

GRANT all privileges on * * to ' hive_user ' @ ' percent ' identified by ' Hive_user ' with GRANT OPTION;

Revoke all on * * from ' hive_user ' @ '% ';

Revoke all on test.* from ' Hive_user ';

FLUSH privileges;

Delete from Mysql.user where user= ' hive_user ';

Revoke all on * * from ' hive_user ' @ '% ';

FLUSH privileges;

GRANT all privileges on * * to ' dev ' @ '% ' identified by ' dev123456 ' with GRANT OPTION;
FLUSH privileges;

Delete from mysql.user where user= ' dev ';

Install mysql-5.7.10 multiple instances on Mac

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.