首页 > 数据库 >window系统安装MYSQL8.0版本完整版

window系统安装MYSQL8.0版本完整版

时间:2022-08-16 10:33:22浏览次数:82  
标签:MySQL8 mysql -- window MYSQL8.0 file MySQL 完整版 my

window系统安装mysql8.0完整版

!!!!本人修改了mysql的端口号3308,可以自己修改my.ini文件中的配置

一、下载两个版本的MySQL

进入官网下载:https://www.mysql.com/

 

 

二、将下载下来的压缩包放到合适的位置并且解压缩

注意:此处先解压安装MySQL8时再解压8.0版本(要不然容易出问题)

配置环境变量

 

 

 

 安装MySQL8

  1、先创建my.ini文件

  

# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows you should keep this file in the installation directory 
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup option 
# "--defaults-file". 
#
# To run run the server from the command line, execute this in a 
# command line shell, e.g.
# mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
#
# To install the server as a Windows service manually, execute this in a 
# command line shell, e.g.
# mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
#
# And then execute this in a command line shell to start the server, e.g.
# net start MySQLXY
#
#
# Guildlines for editing this file
# ----------------------------------------------------------------------
#
# In this file, you can use all long options that the program supports.
# If you want to know the options a program supports, start the program
# with the "--help" option.
#
# More detailed information about the individual options can also be
# found in the manual.
#
#
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]

port=3308

[mysql]

default-character-set=utf8


# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this 
# file.
#
[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3308


#Path to installation directory. All paths are usually resolved relative to this.
basedir="D:/workmenus/MySQL8/MySQL8/mysql-8.0.19-winx64"

#Path to the database root
datadir="D:/workmenus/MySQL8/MySQL8/mysql-8.0.19-winx64/Data/"
# 允许最大连接数
max_connections=10000
# 允许最大连接人数
max_user_connections=1000
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB

# 连接时间
wait_timeout=31536000
interactive_timeout=31536000
 

2、生成data文件夹
  以管理员身份打开cmd命令提示符,切换到MySQL8的 bin 路径下。
  输入命令:mysqld --initialize
  等一段时间,它会重新生成一个 Data 文件夹
  同样找到.err文件,找到对应生成的随机密码

   

 

 

 3、安装MySQL8服务
在命令行输入 (名字命名为MYSQL8,并且指定默认的配置文件为刚才创建的my.ini文件)

mysqld --install MYSQL8 --defaults-file=D:\workmenus\MySQL8\MySQL8\mysql-8.0.19-winx64\my.ini

 4、开启MySQL8服务

  在命令行输入
  net start MYSQL8

 

5、登录MYSQL8,并且修改密码

(1)登录输入:mysql -u root -P 3308 -h localhost -p
密码输入 .err文件里的生成的随机密码
(2)修改密码输入:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';
6、链接成功

 

标签:MySQL8,mysql,--,window,MYSQL8.0,file,MySQL,完整版,my
From: https://www.cnblogs.com/sjzxs/p/16590744.html

相关文章

  • windows安装wsl,在windows中使用ubuntu
    WSL(WindowsSubsystemforLinux)即适用于Linux的Windows子系统,它是随Windows操作系统一起提供。WSL是windows操作系统的子系统,算是一款为windows10以上定制的特别的......
  • windows查看java进程情况
    1.场景有时候我们启动了多个java程序,需要查看各个java程序占用的的内存情况。打开任务管理器选择“进程”,发现有好多java.exe进程,无法直接查看内存使用情况。 jconsol......
  • windows11上打开ie11浏览器(亲测有效)
    使用vbs脚本方式第一步:新建txt文件,复制以下代码CreateObject("InternetExplorer.Application").Visible=true保存,修改后缀名为.vbs双击文件,即可打开ie11第二步在edge......
  • 杀死 Windows 某个端口
    进入终端命令行,输入netstat-aon|findstr3000查找端口号所对应的PID:输入指令taskkill/pid20348/f:......
  • centos/windows服务器,Mysql数据库表结构损坏-已解决
    【问题原因】服务器突然断电【故障报告】数据库表结构损坏【解决思路】进入强制恢复模式,备份库表及数据重建故障发现周末公司断电,周一启动数据库就直接报错了查看日......
  • 解决WINDOWS防火墙开启后Ping不通
    WINDOWS系统由于安全考虑,当开启防火墙时,默认不允许外主机对其进行ping功能,即别的电脑ping不通本机。别的主机ping不通本机是因为本机的防火墙关闭了ICMP回显功能,只要把这回......
  • Chrome 50放弃Windows和OS X
    Chrome浏览器正式为Windows、Linux和Mac系统发布了Chrome50稳定版。如果你还记得Google去年11月曾宣布要在今年4月停止对老旧操作系统的支持,那么此次Chrome50不再支......
  • Windows时间同步命令
    WindowsTime服务scqueryW32TimescstartW32TimeWindows时间同步命令w32tm/config/manualpeerlist:"ntp.aliyun.com"/syncfromflags:manual/reliable:yes/u......
  • C#实现Windows服务安装卸载开启停止
    前言前面一篇文章,我们讲解了如何创建Windows服务,并说明了如何使用installutil.exe来实现服务的安装和卸载。基于C#实现Windows服务今天这篇文章,我们讲解一下如何通过C#......
  • centos挂载windows共享目录
    背景在linux环境下访问远程windows的共享目录,将windows上的目录挂载到linux目录下。如下图:一、windows上新建共享文件夹二、windows上关闭防火墙三、linux挂载wind......