As described earlier, because you need to test the MySQL master-slave configuration scenario, install multiple MySQL. This time, install multiple MySQL 5.7.14 on Ubuntu kylin 14.10.
System environment: Ubuntu Kylin 14.10, 64-bit system
MySQL version: 5.7.14 Community Edition
MySQL Download address: http://dev.mysql.com/downloads/mysql/, select Linux-generic, download the 612.9M mysql-5.7.14-linux-glibc2.5-x86_64. tar.gz
MySQL official installation Documentation: http://dev.mysql.com/doc/refman/5.7/en/ Binary-installation.html1. According to official installation documentation, just some shell commands have been modified, and for Ubuntu, most commands need to add sudo to the front
shell> sudo groupadd mysql shell> sudo useradd-r-g mysql-s/bin/false mysql shell> cd/usr/local shell> su Do tar-zxvf/path/to/mysql-version-os.tar.gz shell> sudo mv mysql-5.7.14-linux-glibc2.5-x86_64 mysql-5.7.14-linux-glibc2.5-x86_64-3306 #将mysql的目录改了一下名 shell> sudo ln-s mysql-5.7.14-linux-glibc2.5-x86_64-3306 mysql-3306 shell> cd mysql-3306 shell> sudo mkdir mysql-files shell> sudo chmod 750 mysql-files shell> sudo ch
Own-r Mysql:mysql.
shell> sudo cp support-files/my-default.cnf./my.cnf #copy一份my. Cnf then edit my.cnf, open Basedir,datadir,port, and so on, as follows: Basedir =/usr/local/mysql-3306 DataDir =/usr/local/mysql-3306/data Port = 3306 server_id = 11 then start initializing Mysql:she on port 3306 ll> sudo bin/mysqld--defaults-file=/usr/local/mysql-3306/my.cnf--initialize--user=mysql 2016-07-29T15 : 38:48.896585z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (the documentation for more details). 2016-07-29t15:38:48.896672z 0 [Warning] ' no_zero_date ', ' no_zero_in_date ' and ' Error_for_division_by_zero ' SQL modes Should is used with strict mode.
They'll be merged and strict mode in a future release.
2016-07-29T15:38:48.896682Z 0 [Warning] ' no_auto_create_user ' SQL mode is not set. 2016-07-29t15:38:50.498675z 0 [Warning] innodb:new log files created, lsn=45790 2016-07-29t15:38:50.890849z 0 [Warning] I
Nnodb:creating FOREIGN KEY constraint system tables. 2016-07-29t15:38:51.062752z 0 [Warning] No existing UUID has been found, so we assume s server has been started.
Generating a new uuid:8c708a13-55a2-11e6-835e-a0481ced538c. 2016-07-29t15:38:51.088854z 0 [Warning] gtid the table isn't ready to be used.
Table ' mysql.gtid_executed ' cannot be opened. 2016-07-29t15:38:51.090179z 1 [note] A temporary password are generated for root@localhost:pjlwjf%q;1t) shell> sudo bi N/mysql_ssl_rsa_setup--defaults-file=/usr/local/mysql-3306/my.cnf GeneratinG A 2048 bit RSA private key ... +++ ... ... +++ writing new private key to ' CA-KEY.PEM '-----generat., F., ...., ...!., ..... ............. ....... ...... ....... ... +++ Writing New private key to ' SERVER-KEY.PEM '-----generating a 2048 bit RSA private key ..... ......................... ... ... +++ ... ... .... ... .... .... +++ Writing new private key to ' CLIENT-KEY.PEM '-----shell> sudo ch., ...., ...., ....., .....!!!!!.
Own-r Root. shell> sudo chown-r mysql data mysql-files shell> sudo bin/mysqld_safe--user=mysql & #启动mysql, running in the background # Next com
Mand is optional shell> cp Support-files/mysql.server/etc/init.d/mysql.server
2. Start login MySQL for related operation
/usr/local/mysql-3306> bin/mysql-uroot-p
Note When performing bin/mysqld initialization, a temporary password is given in the prompt at the end of the command line, and you can log in after the entry. After you log in to MySQL, you need to change your password immediately, otherwise you cannot do anything. Execute the following command to modify the password for ' root ' @ ' localhost ':
mysql> SET PASSWORD = PASSWORD (' Your new PASSWORD ');
Mysql> ALTER USER ' root ' @ ' localhost ' PASSWORD EXPIRE NEVER;
mysql> flush Privileges;
In order to be able to log on remotely, add a ' root ' @ '% ' account:
Copy Code code as follows:
Mysql> grant all privileges in *.* to ' root ' @ '% ' identified by ' your new password ' with GRANT option;
3. According to the above method, continue to extract the installation mysql-5.7.14-linux-glibc2.5-x86_64.tar.gz, and configured as 3307,3308,3309 port, you can install multiple MySQL.
Wonderful topic sharing: MySQL different versions of the installation Tutorials mysql5.7 version Installation Tutorials
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.