网站首页 > 博客文章 正文
一、MySQL数据库下载
1.进入MySQL数据库官网
官网地址:https://www.mysql.com/
2.点击DOWNLOADS,点击MySQL Community (GPL) Downloads ?
3.点击MySQL Community Server,点击Archives,选择数据库版本与操作系统,选择Windows (x86, 64-bit), ZIP Archive,点击Download
二、MySQL配置
1.解压下载的安装包
2.打开解压后的文件,新建文件my.ini
3.编辑配置文件
#配置mysql服务器端信息
[mysqld]
#配置服务器端口号
port=3307
#配置时区为东八区 在此处配置后连接mysql服务器时不必需要每次设置时区timezeServer=PRC
default-time-zone='+8:00'
#设置最大连接数
max_connections=200
#允许失败的连接次数,防止有人试图通过该主机攻击数据库系统
max_connect_errors=10
#服务器使用的默认字符集
character-set-server=utf8
#创建数据表的默认引擎
default-storage-engine=INNODB
#设置默认使用的插件认证 mysql_native_password/caching_sha2_password
#default_authentication_plugin=myql_native_password
#解决导入脚本时function错误(使用source错误和自定义函数错误)
#> 1418 - This function has none of DETERMINISTIC, NO SQL,
#or READS SQL DATA in its declaration and binary logging is enabled
#(you *might* want to use the less safe log_bin_trust_function_creators variable)
log_bin_trust_function_creators=1
#允许执行load data local infile 'c:/a.txt'
local-infile=1
#允许执行select * from XX into outfile 'c:/a.txt'
secure_file_priv=''
#配置mysql客户端信息
[mysql]
#设置默认字符集
default-character-set=utf8
#允许执行load data local infile 'c:/a.txt'
local-infile=1
#设置mysql客户端连接服务器 默认使用的端口 用户名 密码
[client]
port=3307
user=ys2
password=ys23345
三、安装MySQL
1.进入DOS命令窗口,选择MySQL解压文件下的bin文件夹,输入命令,进行初始化
无密码方式初始化
D:\develop\dbms\mysql8.0.27\bin>mysqld --initialize-insecure
初始化完成之后会在MySQL解压文件下生成一个data文件夹
2.创建MySQL服务,并启动服务
D:\develop\dbms\mysql8.0.27>mysql -install mysql
启动服务
D:\develop\dbms\mysql8.0.27\bin>net start mysql
3.登陆MySQL数据库 mysql -h主机地址 -P端口号 -u账号 -p密码
D:\develop\dbms\mysql8.0.27\bin>mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21687
Server version: 8.0.27 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
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
1.停止服务
1.关闭服务
D:\ys2\develop\mysql8.0.27\bin>net stop mysql
2.卸载服务
2.移除mysql
D:\ys2\develop\mysql8.0.27\bin>mysqld -remove mysql
注意:
- mysql的安装与登陆行为都在mysql解压文件的bin目录下进行。
- mysql在登陆数据库时,采用 mysql -h主机地址 -P端口号 -u账号 -p密码 这种方式登陆会将密码暴露在控制台上,不安全。可以采用 mysql -h主机地址 -P端口号 -u账号 -p 不先输入密码,而是在下一行输入密码的方式进行登录。
- 在不指定主机地址和端口号的情况下 默认会从本地和3306端口登录。
- 如果在my.ini配置文件中,配置了要登陆的账号、密码及端口等等,登录时将会不需要指定,可能只输入mysql回车即可。
5.如果在服务启动后进行了配置文件的修改,则最好进行一次服务的重启操作。先停止服务,再开启服务。
以上在mysql8.0.27版本进行,mysql5.6以后版本安装时可直接略过初始化步骤,其余步骤不变。
猜你喜欢
- 2024-09-10 解决Navicat连接 Mysql 8 出现1251- Client does not support错误
- 2024-09-10 win10安装mysql遇到的坑(win10安装mysql5.5)
- 2024-09-10 MySQL系列-二进制包安装(v8.0.24)
- 2024-09-10 Win10+docker+Laradock(下篇):Docker的基本操作与项目开发配置
- 2024-09-10 为Debezium配置MySQL单机版(mysqld 指定配置文件)
- 2024-09-10 Java 连接 MySQL 8.0 排错案例-爱可生
- 2024-09-10 不要再原地踏步了,升级到 MySQL 8.x 的 6 大理由!
- 2024-09-10 Django + MySQL 8 开发环境用 Docker来部署
- 2024-09-10 【每日一学】数据库大揭秘:MySQL 事务学习手册,精通数据操作!
- 2024-09-10 MySQL性能基准测试对比:MySQL 5.7与MySQL 8.0
你 发表评论:
欢迎- 367℃用AI Agent治理微服务的复杂性问题|QCon
- 358℃初次使用IntelliJ IDEA新建Maven项目
- 356℃手把手教程「JavaWeb」优雅的SpringMvc+Mybatis整合之路
- 351℃Maven技术方案最全手册(mavena)
- 348℃安利Touch Bar 专属应用,让闲置的Touch Bar活跃起来!
- 346℃InfoQ 2024 年趋势报告:架构篇(infoq+2024+年趋势报告:架构篇分析)
- 345℃IntelliJ IDEA 2018版本和2022版本创建 Maven 项目对比
- 342℃从头搭建 IntelliJ IDEA 环境(intellij idea建包)
- 最近发表
- 标签列表
-
- powershellfor (55)
- messagesource (56)
- aspose.pdf破解版 (56)
- promise.race (63)
- 2019cad序列号和密钥激活码 (62)
- window.performance (66)
- qt删除文件夹 (72)
- mysqlcaching_sha2_password (64)
- ubuntu升级gcc (58)
- nacos启动失败 (64)
- ssh-add (70)
- jwt漏洞 (58)
- macos14下载 (58)
- yarnnode (62)
- abstractqueuedsynchronizer (64)
- source~/.bashrc没有那个文件或目录 (65)
- springboot整合activiti工作流 (70)
- jmeter插件下载 (61)
- 抓包分析 (60)
- idea创建mavenweb项目 (65)
- vue回到顶部 (57)
- qcombobox样式表 (68)
- vue数组concat (56)
- tomcatundertow (58)
- pastemac (61)
本文暂时没有评论,来添加一个吧(●'◡'●)