MySQL Community Server 5.7安装

来源:互联网 发布:oneinstack java 编辑:程序博客网 时间:2024/05/17 23:25

1.下载

MySQL Community Server 5.7.18

2.解压缩zip包

放到D盘下面,例D:\MySQL

3.环境变量配置

3.1 添加path路径,

D:\MySQL\bin

3.2.在MySQL目录下新建mysql-default.ini配置文件

# These are commonly set, remove the # and set as required.
basedir = D:\MySQL
datadir = D:\MySQL\Data
port = 3306
# server_id = …..

4.以管理员身份进入命令提示符 cmd

进入mysql的bin目录下

Microsoft Windows [版本 6.3.9600]
(c) 2013 Microsoft Corporation。保留所有权利。
C:\Users\Administrator>cd D:
D:\
C:\Users\Administrator>cd D:\MySQL\bin

执行mysqld.exe –initialize 命令,

D:\MySQL\bin>mysqld.exe –initialize
D:\MySQL\bin>

执行完命令创建了data目录以及初始数据。

5.执行 mysqld -install命令

D:\MySQL\bin>mysqld -install
Service successfully installed. //成功安装服务

6.执行mysqld.exe -nt –skip-grant-tables

可以免密进入mysql,注意:窗口无反应

D:\MySQL\bin>mysqld.exe -nt –skip-grant-tables

7.重新打开dos窗口,执行mysql -u root

进入mysql命令行,执行命令

use mysql;
update user set authentication_string=password(‘sa’) where user=‘root’;
set password=Password(‘sa’);

8.在任务管理器中终止mysqld进程,开启mysql服务。


安装完成。

原创粉丝点击