windows安装mysql

windows安装mysql-5.7.27-winx64.zip

1.配置mysql环境变量
2.在bin目录执行mysqld --initialize-insecure
3.在mysql的home目录中新建my.ini文件,配置home目录和data目录,以及导入导出文件目录

[mysqld]
port=3306
character_set_server=utf8
basedir=E:\mysql5.7.23
datadir=E:\mysql5.7.23\data
server-id=1
sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
lower_case_table_names=1
innodb_file_per_table = 1
log_timestamps=SYSTEM

log-error   = error.log
slow_query_log = 1
slow_query_log_file = slow.log
long_query_time = 5
log-bin = binlog
binlog_format = row
expire_logs_days = 15
log_bin_trust_function_creators = 1
secure-file-priv=E:\mysql5.7.23\Uploads
[client]   
default-character-set=utf8

4.用管理员身份打开cmd,执行mysqld --install
5.赋权限:

C:\Windows\system32>mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.27-log MySQL Community Server (GPL)

Copyright (c) 2000, 2019, 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> alter user 'root'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.21 sec)
--刷新权限
mysql> flush privileges;
Query OK, 0 rows affected (0.15 sec)
--赋远程权限
mysql> grant all privileges on *.* TO 'root'@'%' identified by '123456' with grant option;
Query OK, 0 rows affected, 1 warning (0.12 sec)
--刷新权限
mysql> flush privileges;
Query OK, 0 rows affected (0.13 sec)

6.安装完成

参考:https://www.jianshu.com/p/a41d45890ab2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值