ToB企服应用市场:ToB评测及商务社交产业平台

标题: windows同时安装 5.7 8.0 mysql [打印本页]

作者: 来自云龙湖轮廓分明的月亮    时间: 2024-9-10 13:48
标题: windows同时安装 5.7 8.0 mysql
电脑配置升级了,想着自己电脑当地安装数据库,重新学习一下MySQL,下面记载了当地Windows安装两个版本MySQL的过程。
一.安装5.7版本

(1)在解压目录创建配置文件 - my.ini
  1. [mysqld]
  2. # set basedir to your installation path
  3. basedir=D:/Program/mysql/mysql-5.7.24-winx64
  4. # set datadir to the location of your data directory
  5. datadir=D:/Program/mysql/mysql-5.7.24-winx64/data
复制代码
(2)创建data文件夹,初始化数据目录:留意有两种选项

  1. ## 初始化数据目录,使用第一种方式
  2. PS D:\Program\mysql\mysql-5.7.24-winx64\bin> .\mysqld --initialize --user=hecg95
复制代码
(3)首次启动:
  1. ## 启动MySQL
  2. PS D:\Program\mysql\mysql-5.7.24-winx64\bin> .\mysqld --console
  3. ...
  4. 2020-01-06T12:06:55.258100Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
  5. 2020-01-06T12:06:55.258762Z 0 [Note] InnoDB: Uses event mutexes
  6. 2020-01-06T12:06:55.259034Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier
  7. 2020-01-06T12:06:55.259223Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
  8. 2020-01-06T12:06:55.259652Z 0 [Note] InnoDB: Number of pools: 1
  9. 2020-01-06T12:06:55.259933Z 0 [Note] InnoDB: Not using CPU crc32 instructions
  10. 2020-01-06T12:06:55.263195Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
  11. 2020-01-06T12:06:55.268347Z 0 [Note] InnoDB: Completed initialization of buffer pool
  12. 2020-01-06T12:06:55.313150Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
  13. 2020-01-06T12:06:55.366453Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
  14. 2020-01-06T12:06:55.367217Z 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
  15. 2020-01-06T12:06:55.415184Z 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
  16. 2020-01-06T12:06:55.422146Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
  17. 2020-01-06T12:06:55.422578Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
  18. 2020-01-06T12:06:55.423030Z 0 [Note] InnoDB: Waiting for purge to start
  19. 2020-01-06T12:06:55.484660Z 0 [Note] InnoDB: 5.7.24 started; log sequence number 2591440
  20. 2020-01-06T12:06:55.485287Z 0 [Note] Plugin 'FEDERATED' is disabled.
  21. 2020-01-06T12:06:55.485644Z 0 [Note] InnoDB: Loading buffer pool(s) from D:\Program\mysql\mysql-5.7.24-winx64\data\ib_buffer_pool
  22. 2020-01-06T12:06:55.495151Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
  23. 2020-01-06T12:06:55.497758Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
  24. 2020-01-06T12:06:55.498298Z 0 [Note] IPv6 is available.
  25. 2020-01-06T12:06:55.499141Z 0 [Note]   - '::' resolves to '::';
  26. 2020-01-06T12:06:55.499488Z 0 [Note] Server socket created on IP: '::'.
  27. 2020-01-06T12:06:55.503746Z 0 [Note] InnoDB: Buffer pool(s) load completed at 200106 20:06:55
  28. 2020-01-06T12:06:55.540602Z 0 [Note] Event Scheduler: Loaded 0 events
  29. 2020-01-06T12:06:55.541097Z 0 [Note] D:\Program\mysql\mysql-5.7.24-winx64\bin\mysqld.exe: ready for connections.
  30. Version: '5.7.24'  socket: ''  port: 3306  MySQL Community Server (GPL)
复制代码
(4)查找暗码及修改暗码:

二.安装8.0版本

(1)在解压目录创建配置文件 - my.ini
  1. [mysqld]
  2. # set basedir to your installation path
  3. basedir=D:/Program/mysql/mysql-8.0.18-winx64
  4. # set datadir to the location of your data directory
  5. datadir=D:/Program/mysql/mysql-8.0.18-winx64/data
  6. # 多个MySQL时,修改port,换个端口号
  7. port = 13306
复制代码
(2)创建data文件夹,初始化数据目录:留意有两种选项

  1. ## 初始化数据目录,使用第二种方初始化自动创建data文件夹
  2. PS D:\Program\mysql\mysql-8.0.18-winx64\bin> .\mysqld --initialize-insecure --user=hecg95
复制代码
(3)首次启动:
  1. ## 启动MySQL
  2. PS D:\Program\mysql\mysql-8.0.18-winx64\bin> .\mysqld --console
  3. 2020-01-06T12:58:00.798580Z 0 [System] [MY-010116] [Server] D:\Program\mysql\mysql-8.0.18-winx64\bin\mysqld.exe (mysqld 8.0.18) starting as process 33124
  4. 2020-01-06T12:58:01.573236Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
  5. 2020-01-06T12:58:01.604355Z 0 [System] [MY-010931] [Server] D:\Program\mysql\mysql-8.0.18-winx64\bin\mysqld.exe: ready for connections. Version: '8.0.18'  socket: ''  port: 13306  MySQL Community Server - GPL.
  6. 2020-01-06T12:58:01.618988Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060
复制代码
(4)初次登岸及修改暗码:

  启动8.0 服务  mysqld install MySQL80 --defaults-file="D:\DevelopTool\MySQL\mysql-5.7.42\my.ini"  开启服务(管理员打开的cmd窗口开启服务)  mysqld --install mysql88 --defaults-file="E:\mysql-8.0.39-winx64\mysql-8.0.39-winx64\my.ini"  

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4