window环境配置Mysql 5.7.21 windowx64.zip免安装版教程详解

作者:visitor009 时间:2024-01-24 01:19:00 

1.从官网下载mysql-5.7.21-windowx64.zip mysql下载页面

2.解压到合适的位置(E:\mysql) 这名字是我改过的

3.配置环境变量,将E:\mysql\bin 添加到PATH中

4.在mysql目录下(E:\mysql) 创建 my.ini文件,内容如下:


[mysql]  
# 设置mysql客户端默认字符集  
default-character-set=utf8  
[mysqld]  
#设置3306端口  
port = 3306  
# 设置mysql的安装目录  
basedir=E:\mysql
# 设置mysql数据库的数据的存放目录  
datadir=E:\mysql\data
# 允许最大连接数  
max_connections=200  
# 服务端使用的字符集默认为8比特编码的latin1字符集  
character-set-server=utf8  
# 创建新表时将使用的默认存储引擎  
default-storage-engine=INNODB  
"#"为注释

5.管理员身份运行cmd

切换目录 cd E:\mysql\bin

生成mysql服务(就是安装my.ini文件)


E:\mysql\bin> mysqld -install;
Service successfully installed.

生成data目录  E:\mysql\bin> mysqld --initialize-insecure --user=mysql ;

这里生成失败的话看下面


E:\mysql\bin>cd ../
E:\mysql> mysqld --initialize-insecure --user=mysql ;

启动mysql服务


E:\mysql\bin> net start mysql;

MySQL 服务正在启动 . 

MySQL 服务已经启动成功。

6.登录数据库,修改密码(默认为空)


E:\mysql\bin> mysql -u root -p;
Enter password: //这里直接回车
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.21 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, 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>

修改密码


mysql> show databases;
+--------------------+
| Database      |
+--------------------+
| information_schema |
| mysql       |
| performance_schema |
| sys        |
+--------------------+
4 rows in set (0.00 sec)
mysql> use mysql;
Database changed
mysql> set password for 'root'@'localhost'=password('新密码');
mysql> flush privileges;

退出测试是否成功


mysql> quit;
E:\mysql\bin> mysql -u root -p;
Enter password:

注释:

在mysql中一条语句结束加;号

开始mysql服务net start mysql;
停止mysql服务net stop mysql;
生成服务mysqld -install;
删除服务mysqld -remove;
登录数据库mysql -u root -p;
退出mysql> quit;

总结

以上所述是小编给大家介绍的window环境配置Mysql 5.7.21 windowx64.zip免安装版教程详解网站的支持!

来源:https://www.jianshu.com/p/f3dd615c786d

标签:window,x64
0
投稿

猜你喜欢

  • javascript对select标签的控制(option选项/select)

    2024-04-19 10:15:54
  • JavaScript 日期下拉选择器

    2008-10-31 12:13:00
  • 简单的ASP生成HTML并分页程序

    2009-07-20 12:32:00
  • SQL Server Agent 服务启动后又停止问题

    2024-01-25 21:56:49
  • 基于Django框架利用Ajax实现点赞功能实例代码

    2022-01-29 02:35:38
  • 如何利用python将Xmind用例转为Excel用例

    2022-06-18 19:18:46
  • Python查看微信撤回消息代码

    2023-06-12 04:13:44
  • 基于django 的orm中非主键自增的实现方式

    2023-06-04 13:53:54
  • Python实现免费音乐下载器

    2023-12-26 23:51:16
  • Python+matplotlib+numpy实现在不同平面的二维条形图

    2023-11-11 21:01:58
  • 发个选星星打分/投票功能函数

    2008-05-22 12:38:00
  • 备战618!用Python脚本帮你实现淘宝秒杀

    2022-05-15 04:43:40
  • Python 数据可视化之Matplotlib详解

    2022-12-30 05:33:21
  • JavaScript中var let const的用法有哪些区别

    2024-05-09 15:06:33
  • 15个Pythonic的代码示例(值得收藏)

    2022-07-27 21:21:19
  • python实现五子棋程序

    2022-05-26 23:24:31
  • javascript实现下雪效果【实例代码】

    2024-05-25 15:18:40
  • python实现自动登录

    2023-10-20 05:11:46
  • 安装了Office2003补丁之后,access不能用,打不开了

    2011-05-12 12:19:00
  • Python 私有化操作实例分析

    2022-11-06 05:44:42
  • asp之家 网络编程 m.aspxhome.com