惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - 笨功夫才是真功夫

TortoiseSVN实现excel文件差异比对(集成ExcelMerge)[转] git仓库迁移 centos7.6 nginx配置ssl证书 在Debian12上安装mysql 8.0 Mysql8.0设置大小写不敏感解决方案[转] debian下常见问题 vue开发环境搭建 bash脚本的输入参数解析 python常用脚本 mysql数据库备份脚本 redis安装和运维 docker环境下安装RabbitMQ Linux系统设置开机启动(草稿) 在Windows10部署kibana Elasticsearch监控 Flink cdc实践(陆续更新) VMware虚拟机开机自动启动 停止windows10的系统更新 elasticsearch安装-集群 elasticsearch安装-单实例
在windows下安装mysql 8.1
笨功夫才是真功夫 · 2023-12-27 · via 博客园 - 笨功夫才是真功夫

1、下载并解压

官网下载mysql8,https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.11-winx64.zip
解压到D:\mysql, 以下称为根目录

2、编写配置文件

在根目录下新建my.ini文件, 配置以下内容

[mysqld]
# 设置3306端口
port=3306
# 设置mysql的安装目录,一定要与上面的安装路径保持一致
basedir=D:\mysql
# 设置mysql数据库的数据的存放目录,自动生成,无需手动创建,当然也可以放在其他地方
datadir=D:\mysql\data

# 设置日志文件(需提前建立log文件夹)
log_error=D:\mysql\log\error.log
log_output=file
general_log=ON
general_log_file=D:\mysql\log\general.log

# 允许最大连接数
max_connections=200
# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
max_connect_errors=10
# 服务端使用的字符集默认为utf8mb4
character-set-server=utf8mb4
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
# 默认使用“mysql_native_password”插件认证
#mysql_native_password   使用default_authentication_plugin=mysql_native_password是为了后续可以远程连接
default_authentication_plugin=mysql_native_password


#开启binlog日志(8.0默认开启)
#binlog-format=Row

#binlog保留时间设置为7天
#小于8.0的版本的设置参数 
#8.0以上的也是这个设置(binlog_expire_logs_seconds被置为0)。
expire_logs_days=7

[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8mb4

[client]
# 设置mysql客户端连接服务端时默认使用的端口,不建议修改,这是公认端口号
port=3306
default-character-set=utf8mb4

3、初始化mysql

在根目录的bin目录下打开cmd,执行,大约20秒

mysqld --initialize --console

此处有个root随机的密码生成, 注意保留,后续用到。

4、创建mysql的windows服务

mysqld --install

检查服务创建情况, 无问题启动mysql服务

net start mysql 
net stop mysql

5、修改初始密码

先连接到mysql

 mysql -u root -p自动生成的密码 

修改密码:

ALTER USER 'root'@'localhost' IDENTIFIED BY '你的密码';

6、配置允许远程连接访问

use mysql;

#然后查看下当前连接允许情况
select host, user, authentication_string, plugin from user;

#可使用root从任何主机连接到mysql服务器
CREATE USER 'root'@'%' IDENTIFIED BY 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '你的密码';
#授权生效
FLUSH PRIVILEGES;

#再查看下当前连接允许情况
select host, user, authentication_string, plugin from user;

使用dbeaver等工具连接测试。