Because you want to study mycat, you need to install multiple MySQL instances for research. Limited to no more than the computer, can only be installed on this machine. Through the MySQL documentation, self-pondering the installation success!
The directory structure is as follows:
One and two folders are used to simulate database libraries.
Operation Steps:
Copy files
Copy Mysql-5.7.9-win64 directory My-default.ini to Whole, one, two directories, renamed to My.init.
Taking whole library as an example, the one library and the other library can be adjusted accordingly.
1, write \instance\whole\my.init
Innodb_buffer_pool_size = 128M
Basedir = E:\mysql\mysql-5.7.9-winx64
DataDir = E:\mysql\mysql-5.7.9-winx64\instance\whole\data
Port = 3309
server_id = 3
For the Sub-Library, be aware of:
3. Initializing the Data Directory
Mysqld--defaults-file=e:\mysql\instance\whole\my.ini--initialize--console
2017-01-23t01:31:39.492351z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use--explicit_defau
Lts_for_timestamp server option (see documentation for more details).
2017-01-23t01:31:39.492351z 0 [Warning] ' no_zero_date ', ' no_zero_in_date ' and ' Error_for_division_by_zero ' SQL modes Sho
Uld is used with strict mode. They'll is merged with strict mode in a future release.
2017-01-23t01:31:39.492351z 0 [Warning] ' no_auto_create_user ' SQL mode is not set.
2017-01-23t01:31:41.487351z 0 [Warning] innodb:new log files created, lsn=45790
2017-01-23t01:31:41.980351z 0 [Warning] innodb:creating FOREIGN KEY constraint system tables.
2017-01-23t01:31:42.145351z 0 [Warning] No existing UUID have been found, so we assume that's the first time that T
He server has been started. Generating a new uuid:b192bf10-e10b-11e6-b19c-00ffcdaad4ca.
2017-01-23t01:31:42.193351z 0 [Warning] Gtid table is not a ready-to-be used. Table ' mysql.gtid_executed ' cannot be opened
.
2017-01-23t01:31:42.218351z 1 [Note] A temporary password is generated for [email protected]: g0tn0uaqak>e
4. Start the service
Mysqld--defaults-file=e:\mysql\instance\whole\my.ini--console
5. Test Connection:
Mysql-h localhost-u Root--port 3309-p
Mysql> set Password=password (' 123 ');
Query OK, 0 rows affected, 1 Warning (0.00 sec)
in the MySQL document, change the password with: ALTER USER ' root ' @ ' localhost ' identified by 'New_password ';
mysql> alter user ' root ' @ ' localhost ' password expire never;
Query OK, 0 rows Affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| MySQL |
| Performance_schema |
| SYS |
+--------------------+
4 rows in Set (0.00 sec)
6. Close the service
mysqladmin-h localhost--port 3309-p-u root shutdown
7, installation as a service
Mysqld--install-manual Mysqlwhole--defaults-file=e:\mysql\instance\whole\my.ini
Service successfully installed.
Word file
In Windows Service Management:
MySQL one-machine multi-instance installation record