前端之家收集整理的这篇文章主要介绍了
Windows 2012安装mysql 5.7.22 企业版,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
一、环境描述
操作系统:windows 2012
数据库:MysqL 5.7.12 企业版
二、操作步骤
1、规划
MysqL安装文件存放在D:\MysqL,数据目录为E:MysqLdata
2、配置文件位置为d:\MysqL\my.ini 内容如下:
[MysqLd]
port = 3306
basedir= D:\MysqL
datadir= E:\MysqLdata
max_connections=500
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[MysqL]
default-character-set=utf8
3、安装服务
C:\Users\admin>d:
D:\>cd MysqL\bin
D:\MysqL\bin>.\MysqLd -install
4、初始化MysqL
.\MysqLd --initialize-insecure --user=MysqL
5、启动服务
D:\MysqL\bin>net start MysqL
MysqL 服务正在启动 .
MysqL 服务已经启动成功。
6、登陆数据库
D:\MysqL\bin>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.22 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>
7、修改密码
use MysqL;
update MysqL.user set authentication_string=password('qwe12345') where user='root' and Host ='localhost';
flush privileges;
8、关闭服务
D:\MysqL\bin>net stop MysqL
MysqL 服务正在停止.
MysqL 服务已成功停止。
原文链接:https://www.f2er.com/windows/372525.html