下载链接
提取码:57yz
以下是操作步骤,博主解压到D盘的根目录,如果自定义目录,自行更换相关配置即可。
1,解压到D盘根目录,打开文件夹,复制my-default.ini 重命名 my.ini :
2,修改my.ini文件内容(把下面的内容直接覆盖即可)
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
#安装目录
basedir = D:\mysql-5.7.17-winx64
#数据存放目录 data目录是要单独创建的,记得是个空文件夹
datadir =D:\mysql-5.7.17-winx64\data
#端口
port = 3306
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
# 最大连接数量
max_connections = 100
#单个内存表的最大值限定
max_heap_table_size = 64M
#为每个线程分配的排序缓冲大小
sort_buffer_size = 8M
#join 连表操作的缓冲大小,根据实际业务来设置,默认8M
join_buffer_size = 32M
# sql查询缓存,如果提交的查询与几次中的某查询相同,并且在query缓存中存在,则直接返回缓存中的结果
query_cache_size = 64M
3.在我的电脑–属性–环境变量设置
添加环境变量 MYSQL_HOME = D:\mysql-5.7.17-winx64
然后在path后面添加 %MYSQL_HOME%\bin
4.以管理员身份打开cmd窗口后,将目录切换到你解压文件的bin目录
执行 mysqld --install
继续执行 mysqld --initialize-insecure --user=mysql;
5,启动MySQL服务----> 执行 net start mysql 启动服务
6.进入mysql 修改root密码
默认的root密码是空的。
执行 mysql -uroot -p
回车进入 默认没密码
切换到数据库mysql
use mysql
修改密码:
set password = password(‘admin’);
并刷新权限:
flush privileges;
7,使用Navicat来连接数据库
链接:https://pan.baidu.com/s/1ul5zT3CKTG1uZlb21PC4Bg
提取码:5dyn
这里只分享工具,各位读者自行使用,比较简单了。