Feng’ Blog

Windows安装Mysql zip版
至MySQL官网下载压缩并解压:https://dev.mysql.com/downloads/将解压后的MySQ...
扫描右侧二维码阅读全文
14
2018/03

Windows安装Mysql zip版

mysql2018123151545.png


至MySQL官网下载压缩并解压:

https://dev.mysql.com/downloads/

将解压后的MySQL放置到要安装的目录

在MySQL目录中创建mysql.ini

mysql.ini内容为:

[mysql]
default-character-set=utf8
[mysqld]
basedir = D:Program Filesmysql #替换为mysql安装目录
datadir = D:Program Filesmysqldata #替换为mysql安装目录下data目录
port = 3306
max_connections=200
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

以管理员运行Cmd

打开mysql文件夹

cd mysql5.7

进入bin目录

cd bin

安装mysql服务

mysqld --install-manual

设置mysql默认mysql.ini

mysqld --defaults-file="D:Program Filesmysqlmysql.ini"

启动mysql服务

net start mysql
初始密码

查看Data目录下**.err文件,搜索"password is generated",结束就是初始密码

mysql初始密码是无法作为登陆使用的,所以登陆mysql必须修改自动生成的密码。

-- 登录数据库
mysql -u root -h 127.0.0.1 -p
Enter password: 输入初始密码
-- 修改密码
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('新密码');
-- 刷新
mysql> flush privileges;

Last modification:January 9th, 2019 at 10:42 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment