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