mysql一机多实例,mysql一机多实例安装记录

拷贝文件

拷贝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要注意:

f33555da2cc99a281703e2def19af81c.png

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

b292b9cfc97edb5252a883081cce9fef.png

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服务管理中:

c840ec0f0a1ddf5a9b1e38181836e9c9.png

mysql一机多实例安装记录

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

本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉

本文系统来源:http://www.cnblogs.com/fgq841103/p/6445320.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值