windows安装Mysql解压版

windows安装Mysql解压版

一、下载mysql-8.0.36-winx64.zip

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


二、解压

三、配置

3.1. 添加环境变量:新建MYSQL_HOME

java 复制代码
MYSQL_HOME
java 复制代码
%MYSQL_HOME%\bin

3.2.如何验证是否添加成功:必须以管理员身份启动

如果提示Can't connect to MySQL server on 'localhost'则证明添加成功;

如果提示mysql不是内部或外部命令,也不是可运行的程序或批处理文件则表示添加添加失败,请重新检查步骤并重试。

java 复制代码
mysql

3.3. 初始化MySQL:必须以管理员身份启动

以管理员身份,运行命令行窗口:

java 复制代码
mysqld --initialize-insecure

如果没有出现报错信息,则证明data目录初始化没有问题,此时再查看MySQL目录下已经有data目录生成。

3.4. 注册MySQL服务:必须以管理员身份启动

复制代码
mysqld -install

计算机上已经安装好了MySQL服务了

3.5. 启动MySQL服务

java 复制代码
net start mysql  // 启动mysql服务
    
net stop mysql  // 停止mysql服务

3.6. 修改默认账户密码

在黑框里敲入mysqladmin -u root password 123456,这里的123456就是指默认管理员(即root账户)的密码。

复制代码
mysqladmin -u root password 123456

四、登录MySQL

输入mysql -uroot -p1234,回车,出现下图且左下角为mysql>,则登录成功。

复制代码
mysql -uroot -p123456

六、退出mysql:

复制代码
exit
quit

七、登陆参数:

复制代码
mysql -u用户名 -p密码 -h要连接的mysql服务器的ip地址(默认127.0.0.1) -P端口号(默认3306)

八、卸载MySQL

点击开始菜单,输入cmd,选择 "命令提示符",选择右侧的 "以管理员身份运行"。

复制代码
net stop mysql

mysqld -remove mysql

删除MySQL目录及相关的环境变量

九、MySQL卸载完成

十、my-default.ini

java 复制代码
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/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.

[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 

endl

相关推荐
马里马里奥-3 小时前
在Windows系统部署本地智能问答系统:基于百度云API完整教程
windows·云计算·百度云
Lx3523 小时前
排序缓冲区调优:sort_buffer_size的合理配置
sql·mysql·性能优化
曹勖之9 天前
simuilink和ROS2数据联通,Run后一直卡在Initializting
windows·matlab·simulink·ros2
feifeigo1239 天前
Java 正则表达式高级用法
java·mysql·正则表达式
浩浩测试一下9 天前
渗透测试指南(CS&&MSF):Windows 与 Linux 系统中的日志与文件痕迹清理
linux·运维·windows·安全·web安全·网络安全·系统安全
敏叔V5879 天前
大模型Text2SQL之在CentOS上使用yum安装与使用MySQL
linux·mysql·centos
驱动小百科9 天前
如何在Windows上安装.NET Framework 详细教程分享
windows·.net·.net framework·.net安装·.net下载
程序猿小D9 天前
[附源码+数据库+毕业论文]基于Spring+MyBatis+MySQL+Maven+Vue实现的校园二手交易平台管理系统,推荐!
java·数据库·mysql·spring·vue·毕业设计·校园二手交易平台
斯密码赛我是美女9 天前
周报报报报
windows
张太行_9 天前
MySQL与Excel比较
数据库·mysql·excel