内容简介:这篇文章主要为大家详细介绍了window环境下mysql5.7.21安装配置方法图文教程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
window环境安装 mysql 5.7.21,具体内容如下
1. 从MySQL官网下载免安装的压缩包mysql-5.7.21-winx64.zip
2. 解压到相应的目录(此处解压到F:\mysql-5.7.21-winx64)
3. 配置环境变量,将MySQL的启动目录(F:\mysql-5.7.21-winx64\bin)添加到Path中
4. 在MySQL目录下(F:\mysql-5.7.21-winx64)创建my.ini文件,内容如下:
[mysql] # 设置mysql客户端默认字符集 default-character-set=utf8 [mysqld] #设置3306端口 port = 3306 # 设置mysql的安装目录 basedir=F:\mysql-5.7.21-winx64 # 设置mysql数据库的数据的存放目录 datadir=F:\mysql-5.7.21-winx64\data # 允许最大连接数 max_connections=200 # 服务端使用的字符集默认为8比特编码的latin1字符集 character-set-server=utf8 # 创建新表时将使用的默认存储引擎 default-storage-engine=INNODB
5. 管理员身份运行cmd
切换目录:C:\Windows\system32>cd F:\mysql-5.7.21-winx64\bin
生成MySQL服务:
F:\mysql-5.7.21-winx64\bin>mysqld -install Service successfully installed.
生成data目录:F:\mysql-5.7.21-winx64\bin>mysqld --initialize-insecure --user=mysql
启动MySQL服务:
C:\Windows\system32>net start mysql MySQL 服务正在启动 . MySQL 服务已经启动成功。
6. 登录数据库,修改密码(默认密码为空)
登录数据库:
C:\Windows\system32>mysql -uroot -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>
mysql>
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql> use mysql;
Database changed
mysql> update user set authentication_string=password("新密码") where User="root";
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
mysql>
mysql>FLUSH PRIVILEGES;
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Netty实战
诺曼·毛瑞尔(Norman Maurer)、马文·艾伦·沃尔夫泰尔(Marvin Allen Wolfthal) / 何品 / 人民邮电出版社 / 2017-5-1 / 69.00
编辑推荐 - Netty之父”Trustin Lee作序推荐 - 阿里巴巴中间件高级技术专家为本书中文版作序推荐 - 系统而详细地介绍了Netty的各个方面并附带了即用型的优质示例 - 附带行业一线公司的案例研究 - 极实用的Netty技术书 无论是构建高性能的Web、游戏服务器、推送系统、RPC框架、消息中间件还是分布式大数据处理引擎,都离不开Nett......一起来看看 《Netty实战》 这本书的介绍吧!