当前位置:Gxlcms > 数据库问题 > mysql一机多实例安装记录

mysql一机多实例安装记录

时间:2021-07-01 10:21:17 帮助过:25人阅读

 

拷贝文件

拷贝mysql-5.7.9-win64目录下的my-default.ini分别到whole、one、two目录下,更名为my.init。

 

以whole库 为例说明,one库和two库做相应调整即可。

1、编写\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

 

对于分库two要注意:

技术分享

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 be used with strict mode. They will be merged with strict mode in a future release.

2017-01-23T01:31:39.492351Z 0 [Warning] ‘NO_AUTO_CREATE_USER‘ sql mode was 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 has been found, so we assume that this is the first time that t

his 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 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 root@localhost: g0tN0uAqak>e

 

4、启动服务

mysqld --defaults-file=E:\mysql\instance\whole\my.ini --console 

5、测试连接:

mysql -h localhost -u root --port 3309 -p

技术分享

 

mysql> set password=password(‘123‘);

Query OK, 0 rows affected, 1 warning (0.00 sec)

 


 

mysql 文档中,修改密码用的是: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、关闭服务

mysqladmin -h localhost --port 3309 -p  -u root shutdown

 

7、安装为服务

mysqld --install-manual MySqlWhole  --defaults-file=E:\mysql\instance\whole\my.ini

Service successfully installed.

 

word文件

 

windows服务管理中:

技术分享

 

mysql一机多实例安装记录

标签:files   file   details   ide   roo   cto   _for   没有   com   

人气教程排行