zoukankan      html  css  js  c++  java
  • mysql一机多实例安装记录

    因为想研究mycat,所以需要安装多个mysql实例进行研究。限于没有多于计算机,只能在本机安装了。通过mysql文档,自己琢磨着安装成功!

    目录结构如下:

    其中one和two文件夹用来模拟数据库分库。

    操作步骤:

    拷贝文件

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

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

    1、编写instancewholemy.init

    innodb_buffer_pool_size = 128M

    basedir = E:mysqlmysql-5.7.9-winx64

    datadir = E:mysqlmysql-5.7.9-winx64instancewholedata

    port = 3309

    server_id = 3

    对于分库two要注意:

    3、Initializing the Data Directory 

    mysqld --defaults-file=E:mysqlinstancewholemy.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:mysqlinstancewholemy.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:mysqlinstancewholemy.ini

    Service successfully installed.

    word文件

    windows服务管理中:

  • 相关阅读:
    训练集、验证集和测试集的区别
    视频分类论文“Towards Good Practices for Very Deep Two-Stream ConvNets”程序运行过程
    201571030304/201571030311《小学四则运算练习软件软件需求说明》结对项目报告
    201571030304/201571030311《小学四则运算练习软件》结对项目报告
    实验二 软件工程个人项目
    实验一 软件工程准备
    MySQL的卸载与安装
    大宗商品
    Web_Servlet四大域对象
    Web_Servlet之间请求转发
  • 原文地址:https://www.cnblogs.com/fgq841103/p/6445320.html
Copyright © 2011-2022 走看看