mysql-5.7.20-winx64安装教程

mysql-5.7.20-winx64安装教程

1.下载解压

下载mysql-5.7.20-winx64.zip并解压缩,链接:https://pan.baidu.com/s/1c2CUMI0 密码:ssst,本文解压到D:\Program Files\mysql-5.7.20-winx64
解压缩

2.环境变量

系统变量配置MYSQL_HOME以及Path
配置MYSQL_HOME
配置Path

3.my.ini配置

在解压目录下找到bin目录,并且新增my.ini文件,文件内容如下

[client]
default-character-set=utf8
[mysqld] 
port=3306 
basedir=%MYSQL_HOME%
datadir=%MYSQL_HOME%\data 
character-set-server=utf8 
default-storage-engine=INNODB
[mysql] 
default-character-set=utf8

my.ini

4.cmd操作

以系统管理员身份运行cmd,依次执行命令
cd进入到bin目录(不知道为啥没进入目录的时候,后面无法启动服务)
初始化数据库,不生成随机密码(会在mysql目录生成data目录,如果已经有data目录了那就先手动删除)
安装mysql服务
启动mysql服务
初始化root用户密码为123456
尝试登陆mysql

C:\Windows\system32>D:

D:\>cd D:\Program Files\mysql-5.7.20-winx64\bin

D:\Program Files\mysql-5.7.20-winx64\bin>mysqld --initialize-insecure

D:\Program Files\mysql-5.7.20-winx64\bin>mysqld --install
Service successfully installed.

D:\Program Files\mysql-5.7.20-winx64\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。


D:\Program Files\mysql-5.7.20-winx64\bin>mysqladmin -u root password 123456
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.

D:\Program Files\mysql-5.7.20-winx64\bin>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.20 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, 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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

mysql>

cmd命令

这里写图片描述

  • 3
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值