win10 上面如何安装多个 MySQL8

1.官网下载 MySQL Community Downloads

https://dev.mysql.com/downloads/mysql/

2.解压到你要安装的目录

3.在MySQL的根目录下面新建my.ini的配置文件

  1. [mysqld]
  2. # 设置3306端口
  3. port=3306
  4. # 设置mysql的安装目录(需要设置为自己的安装目录)
  5. basedir=D:\Programming\MySQL8\MySQL1\mysql-8.0.18-winx64
  6. # 设置mysql数据库的数据的存放目录(mysql-8.0.18不需要手动创建data文件夹)
  7. datadir=D:\Programming\MySQL8\MySQL1\mysql-8.0.18-winx64\data
  8. # 允许最大连接数
  9. max_connections=200
  10. # 允许连接失败的次数(这是为了防止有人从该主机试图攻击数据库系统)
  11. max_connect_errors=10
  12. # 服务端使用的字符集默认为utf8mb4
  13. character-set-server=utf8mb4
  14. # 创建新表时将使用的默认存储引擎
  15. default-storage-engine=INNODB
  16. # 默认使用mysql_native_password插件认证
  17. default_authentication_plugin=mysql_native_password
  18. # 去掉sql_mode中的only_full_group_by
  19. sql_mode=strict_trans_tables,no_zero_in_date,no_zero_date,error_for_division_by_zero,no_engine_substitution
  20. [mysql]
  21. # 设置mysql客户端默认字符集
  22. default-character-set=utf8mb4
  23. [client]
  24. # 设置mysql客户端连接服务端时默认使用的端口
  25. port=3306
  26. default-character-set=utf8mb4

4.通过管理员的身份打开cmd窗口跳转路径到MySQL的bin目录

  1. # 进入到mysql的bin目录底下操作:
  2. # 初始化mysql
  3. mysqld --defaults-file=D:\Programming\MySQL8\MySQL1\mysql-8.0.18-winx64\my.ini --initialize --console
  4. # 安装mysql服务
  5. mysqld --install [服务名] MySQL1 --defaults-file=D:\Programming\MySQL8\MySQL1\mysql-8.0.18-winx64\my.ini
  6. mysqld --install MySQL1 --defaults-file=D:\Programming\MySQL8\MySQL1\mysql-8.0.18-winx64\my.ini
  7. # 启动mysql服务
  8. net start [服务名]
  9. net start mysql1
  10. # 停止mysql服务
  11. net stop [服务名]
  12. net stop mysql1
  13. # 卸载mysql服务
  14. mysqld -remove [服务名]
  15. mysqld --remove mysql1
  16. # 登录mysql
  17. mysql -h localhost -u root -P 3306 -p
  18. # 修改mysql密码
  19. alter user 'root'@'localhost' identified with mysql_native_password by '123456';
  20. flush privileges;
  21. # 开启mysql远程访问
  22. # 方式一:
  23. use mysql;
  24. create user 'root'@'%' identified by '123456';
  25. grant all on *.* to 'root'@'%';
  26. alter user 'root'@'%' identified with mysql_native_password by '123456';
  27. flush privileges;
  28. # 方式二:
  29. use mysql;
  30. select user,authentication_string,host from user;
  31. update user set host = '%' where user = 'root';
  32. flush privileges;
  33. alter user 'root'@'%' identified with mysql_native_password by '123456';

5.其他

MySQL2安装步骤

  1. D:\Programming\MySQL8\MySQL2\mysql-8.0.18-winx64\bin>mysqld --defaults-file=D:\Programming\MySQL8\MySQL2\mysql-8.0.18-winx64\my.ini --initialize --console
  2. 2019-11-06T13:19:04.091682Z 0 [System] [MY-013169] [Server] D:\Programming\MySQL8\MySQL2\mysql-8.0.18-winx64\bin\mysqld.exe (mysqld 8.0.18) initializing of server in progress as process 3276
  3. 2019-11-06T13:19:07.073501Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: X>cZPPE6Qkpi
  4. D:\Programming\MySQL8\MySQL2\mysql-8.0.18-winx64\bin>mysqld --install MySQL2 --defaults-file=D:\Programming\MySQL8\MySQL2\mysql-8.0.18-winx64\my.ini
  5. Service successfully installed.
  6. D:\Programming\MySQL8\MySQL2\mysql-8.0.18-winx64\bin>net start mysql2
  7. MySQL2 服务正在启动 .
  8. MySQL2 服务已经启动成功。
  9. D:\Programming\MySQL8\MySQL2\mysql-8.0.18-winx64\bin>mysql -h localhost -u root -P 3307 -p
  10. Enter password: ************
  11. Welcome to the MySQL monitor. Commands end with ; or \g.
  12. Your MySQL connection id is 8
  13. Server version: 8.0.18
  14. Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
  15. Oracle is a registered trademark of Oracle Corporation and/or its
  16. affiliates. Other names may be trademarks of their respective
  17. owners.
  18. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  19. mysql> alter user 'root'@'localhost' identified with mysql_native_password by '123456';
  20. Query OK, 0 rows affected (0.01 sec)
  21. mysql> flush privileges;
  22. Query OK, 0 rows affected (0.00 sec)
  23. mysql> use mysql;
  24. Database changed
  25. mysql> create user 'root'@'%' identified by '123456';
  26. Query OK, 0 rows affected (0.00 sec)
  27. mysql> grant all on *.* to 'root'@'%';
  28. Query OK, 0 rows affected (0.00 sec)
  29. mysql> alter user 'root'@'%' identified with mysql_native_password by '123456';
  30. Query OK, 0 rows affected (0.00 sec)
  31. mysql> flush privileges;
  32. Query OK, 0 rows affected (0.00 sec)
  33. mysql>

MySQL3安装步骤

  1. D:\Programming\MySQL8\MySQL3\mysql-8.0.18-winx64\bin>mysqld --defaults-file=D:\Programming\MySQL8\MySQL3\mysql-8.0.18-winx64\my.ini --initialize --console
  2. 2019-11-06T13:22:41.619497Z 0 [System] [MY-013169] [Server] D:\Programming\MySQL8\MySQL3\mysql-8.0.18-winx64\bin\mysqld.exe (mysqld 8.0.18) initializing of server in progress as process 3956
  3. 2019-11-06T13:22:44.022580Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: dF-++?wor5oH
  4. D:\Programming\MySQL8\MySQL3\mysql-8.0.18-winx64\bin>mysqld --install MySQL3 --defaults-file=D:\Programming\MySQL8\MySQL3\mysql-8.0.18-winx64\my.ini
  5. Service successfully installed.
  6. D:\Programming\MySQL8\MySQL3\mysql-8.0.18-winx64\bin>net start mysql3
  7. MySQL3 服务正在启动 .
  8. MySQL3 服务已经启动成功。
  9. D:\Programming\MySQL8\MySQL3\mysql-8.0.18-winx64\bin>mysql -h localhost -u root -P 3308 -p
  10. Enter password: ************
  11. Welcome to the MySQL monitor. Commands end with ; or \g.
  12. Your MySQL connection id is 8
  13. Server version: 8.0.18
  14. Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
  15. Oracle is a registered trademark of Oracle Corporation and/or its
  16. affiliates. Other names may be trademarks of their respective
  17. owners.
  18. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  19. mysql> alter user 'root'@'localhost' identified with mysql_native_password by '123456';
  20. Query OK, 0 rows affected (0.00 sec)
  21. mysql> flush privileges;
  22. Query OK, 0 rows affected (0.00 sec)
  23. mysql> use mysql;
  24. Database changed
  25. mysql> create user 'root'@'%' identified by '123456';
  26. Query OK, 0 rows affected (0.00 sec)
  27. mysql> grant all on *.* to 'root'@'%';
  28. Query OK, 0 rows affected (0.01 sec)
  29. mysql> alter user 'root'@'%' identified with mysql_native_password by '123456';
  30. Query OK, 0 rows affected (0.00 sec)
  31. mysql> flush privileges;
  32. Query OK, 0 rows affected (0.00 sec)
  33. mysql>

win 10 下面安装 mysql-8.0.12-winx64 的过程的更多相关文章

  1. Linux安装mysql.8.0.12

    1. linux安装mysql8.0.12,亲测可用. 以下是安装过程中出现的问题: 1 [root@localtest1 file]# systemctl start mysqld 2 Job fo ...

  2. win10 安装mysql 8.0.12

    按照CSDN以及博客园的其他教程, 之前安装过几次都有或多或少的bug 主要安装步骤: 1.配置my.ini文件 2.管理员进入终端, 切换到.../bin目录下进行操作 3.指令操作: 1) mys ...

  3. 【Linux】CentOS 7.4 安装 MySQL 8.0.12 解压版

    安装环境/工具 1.Linux(CentOS 7.4版) 2.mysql-8.0.12-el7-x86_64.tar.gz 安装步骤 参考:https://dev.mysql.com/doc/refm ...

  4. windows下mysql 8.0.12安装步骤及基本使用教程

    本文实例为大家分享了windows下mysql 8.0.12安装步骤及使用教程,供大家参考,具体内容如下 补充:mysql 已经更新到了 8.0.19,大致步骤和这个差不多,照着来就完事了. 我下载的 ...

  5. MySQL 8.0.12 基于Windows 安装教程(超级详细)

    MySQL 8.0.12 基于Windows 安装教程(超级详细) (一步一步来,装不了你找我!) 本教程仅适用Windows系统,如果你原本装了没装上,一定要先删除原本的数据库,执行:mysqld ...

  6. 安装Mysql 8.0的艰难体验

    背景: Mysql 8.0 以后版本,在性能等方面有了很大提升,而且在自动编号.Timestamp等字段的设置上有了很方便的进步,因此在一年前即开始将原有的基于5.5版本的服务器逐渐向8.0转移.但转 ...

  7. centos 8及以上安装mysql 8.0

    本文适用于centos 8及以上安装mysql 8.0,整体耗时20分钟内,不需要FQ 1.环境先搞好 systemctl stop firewalld //关闭防火墙 systemctl disab ...

  8. cmake编译安装mysql 5.6.12

    cmake安装mysql 5.6.12 从mysql 5.5 开始就要用cmake编译安装 下载mysql 下载地址:http://pan.baidu.com/s/1o68xxqE 一.安装mysql ...

  9. windows下安装 mysql 8.0 以上版本以及遇到的问题

    Windows 上安装 MySQL Windows 上安装 MySQL 相对来说会较为简单,地那就链接 https://cdn.mysql.com//Downloads/MySQL-8.0/mysql ...

  10. SQLyog 报错2058 :连接 mysql 8.0.12 解决方法

    今天闲来无事,下载新版的 mysql 8.0.12 安装. 为了方便安装查看,我下载了sqlyog 工具 连接 mysql 配置新连接报错:错误号码 2058,分析是 mysql 密码加密方法变了. ...

随机推荐

  1. 【题解】Huge Mods UVa 10692 欧拉定理

    题意:计算a1^( a2^( a3^( a4^( a5^(...) ) ) ) ) % m的值,输入a数组和m,不保证m是质数,不保证互质 裸的欧拉定理题目,考的就一个公式 a^b = a^( b % ...

  2. springboot-为内置tomcat设置虚拟目录

    需求 项目使用springboot开发,以jar包方式部署.项目中文件上传均保存到D判断下的upload目录下. 在浏览器中输入http://localhost:8080/upload/logo_1. ...

  3. git概论

    感谢:http://www.cnblogs.com/atyou/archive/2013/03/11/2953579.html git,一个非常强大的版本管理工具.Github则是一个基于Git的日益 ...

  4. C语言数据结构-栈

    一.栈的定义 栈(statck)这种数据结构在计算机中是相当出名的.栈中的数据是先进后出的(First In Last Out, FILO).栈只有一个出口,允许新增元素(只能在栈顶上增加). 移出元 ...

  5. 【BZOJ1038】【ZJOI2008】瞭望塔 [模拟退火]

    瞭望塔 Time Limit: 10 Sec  Memory Limit: 162 MB[Submit][Status][Discuss] Description 致力于建设全国示范和谐小村庄的H村村 ...

  6. centos6.4 yum安装nginx+mysql+php

    1.配置防火墙,开启80端口.3306端口vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport ...

  7. js_参数的get传输,从一个页面到另外一个页面。

    2017年10月31日,今天是万圣节,欢乐谷搞事情. 刚接触前端那会是分不清,前端和后台的,后台的数据如何传输到前端的. 现在用的还是Jquery的ajax请求后台数据到前端页面的,需要学习的地方还有 ...

  8. javascript中=、==与===的区别

    1.等号 =赋值运算符,给变量赋值 var a="1"; 2.相等和不相等操作符 相等操作符由==表示,若两个操作数相等,则返回true:不相等操作符由!=表示,若两个操作数不相等 ...

  9. mysql where/having区别

    mysql> select 2-1 as a,password from mysql.user where user='root' having a>0; +---+----------- ...

  10. SourceTree 过期,注册导入许可证

    参考这里:SourceTree过期,需要注册导入 SourceTree License 许可证 很详细 补充: 如果在 SourceTree 软件里注册失败,可以在网页注册. 如果其他邮箱不支持,可以 ...