mysql-8.0.18-winx64的zip安装

1官网下载zip文件,并解压到指定目录https://dev.mysql.com/downloads/mysql/

(mysql-8.0.18-winx64.zip)

2官网安装教程https://dev.mysql.com/doc/refman/8.0/en/windows-create-option-file.html

3在mysql解压目录下新建一个配置文件my.ini

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]
# 设置3306端口
port=3306
# 设置mysql的安装目录
basedir=D:\work\mysql-8.0.18-winx64
# 设置mysql数据库的数据的存放目录
datadir=D:\work\mysql-8.0.18-winx64\data
# 允许最大连接数
max_connections=200
# 允许连接失败的次数。
max_connect_errors=10
# 服务端使用的字符集默认为utf8mb4
character-set-server=utf8mb4
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
# 默认使用“mysql_native_password”插件认证
#mysql_native_password
default_authentication_plugin=mysql_native_password
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8mb4
[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3306
default-character-set=utf8mb4
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

 以系统管理员身份,启动,开始时老是报错启动异常,莫名又ok了,此时初始化完成后,就生成了一个随机密码

PS D:\work\mysql-8.0.18-winx64\bin> mysqld --initialize --console
2019-12-06T03:19:04.768001Z 0 [System] [MY-013169] [Server] D:\work\mysql-8.0.18-winx64\bin\mysqld.exe (mysqld 8.0.18) initializing of server in progress as process 17544
2019-12-06T03:19:06.637812Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: wybAuNOyd8;c

安装mysql服务

PS D:\work\mysql-8.0.18-winx64\bin> mysqld --install
The service already exists!
The current server installed: D:\work\mysql-8.0.18-winx64\bin\mysqld.exe MySQL

服务已经存在可执行删除 sc delete msyql 再执行安装

启动服务,并利用上面生成的随机密码登录服务,并修改root账户密码为root

PS D:\work\mysql-8.0.18-winx64\bin> net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

PS D:\work\mysql-8.0.18-winx64\bin> mysql -uroot -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.18

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> alter user 'root'@'localhost' identified by 'root'
    -> ;
Query OK, 0 rows affected (0.02 sec)

5 将mysql服务添加到系统环境变量中 path中

 

在计算机管理中查看msyql服务是否为自动开启

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
mysql8安装包以及安装说明,在centeros7下的安装.解压缩后会有两个文件:mysql-8.0.18-1.el7.x86_64.rpm-bundle.tar和mysql8安装说明.txt 1、安装 rpm -i 需要安装的包文件名 举例如下: rpm -i example.rpm 安装 example.rpm 包; rpm -iv example.rpm 安装 example.rpm 包并在安装过程中显示正在安装的文件信息; rpm -ivh example.rpm 安装 example.rpm 包并在安装过程中显示正在安装的文件信息及安装进度; 2、查看安装完成的软件 rpm -qa | grep mysql mysql-community-libs-5.7.24-1.el7.x86_64 mysql-community-common-5.7.24-1.el7.x86_64 mysql-community-client-5.7.24-1.el7.x86_64 mysql-community-server-5.7.24-1.el7.x86_64 3、卸载软件 rpm -e --nodeps 要卸载的软件包 rpm -e --nodeps mysql-community-libs-5.7.24-1.el7.x86_64 rpm -e --nodeps mysql-community-common-5.7.24-1.el7.x86_64 rpm -e --nodeps mysql-community-client-5.7.24-1.el7.x86_64 rpm -e --nodeps mysql-community-server-5.7.24-1.el7.x86_64 看看系统中有没有自带有mysql的东西,有就先删除掉。 查看: find / -name mysql 删除: rm -rf 上边查找到的路径,多个路径用空格隔开 #或者下边一条命令即可 find / -name mysql|xargs rm -rf; mkdir -p /usr/local/mysql8 cd /usr/local/mysql8 ll 将下载的资源包(mysql-8.0.18-1.el7.x86_64.rpm-bundle.tar)上传到 usr/local/mysql8 目录下,并解压 tar -xvf mysql-8.0.18-1.el7.x86_64.rpm-bundle.tar 依次安装 rpm -ivh mysql-community-common-8.0.15-1.el7.x86_64.rpm rpm -ivh mysql-community-libs-8.0.18-1.el7.x86_64.rpm rpm -ivh mysql-community-client-8.0.18-1.el7.x86_64.rpm rpm -ivh mysql-community-server-8.0.18-1.el7.x86_64.rpm 查看已安装资源 rpm -qa | grep mysql groupadd mysql useradd -g mysql mysql mysqld --initialize 初始化 chown mysql:mysql /var/lib/mysql -R 授权 systemctl start mysqld 开启mysql服务 systemctl status mysqld 查看mysql 状态 cat /var/log/mysqld.log | grep password 查看root初始密码 使用root用户登录mysql ,并修改root用户密码 mysql -u root -p #回车之后输入前面的初始密码也就是 XXXXXX(填自己的密码) ALTER USER "root"@"localhost" IDENTIFIED BY "自己的密码"; FLUSH PRIVILEGES; #立即生效 再次用户root 用户登录 输入自己刚刚修改的密码就可以了 远程连接 use mysql; update user set host = '%' where user ='root'; ALTER USER 'root'@'%' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #更改加密方式 ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '自己的密码'; #更新用户密码 (我这里为root )
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值