mysqld install MySQL --defaults-file=“C:\Users\mysql-5.7.25-winx64\my.ini”发现配置文件位置写错了怎么办

本文指导如何修正mysqldinstall时配置文件路径错误,并解决服务已存在的问题。步骤包括以管理员身份运行,检查并删除原有mysql服务,然后重新安装MySQL。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

mysqld install MySQL --defaults-file=“C:\Users\mysql-5.7.25-winx64\my.ini”发现配置文件位置写错了怎么办?
如果你重新写对配置文件的地址重新执行命令还是会报“The service already exists”
在这里插入图片描述

如果出现这个种情况只需把原来的服务移除掉就可以了,怎么移除呢?
1、重新以管理员身份运行,输入sc query mysql,查看一下名为mysql的服务
2、命令sc delete mysql,删除该mysql
在这里插入图片描述

然后再重新安装就可以了

Microsoft Windows [版本 6.1.7601] 版权所有 (c) 2009 Microsoft Corporation。保留所有权利。 C:\Users\Administrator\Desktop\mysql-5.7.28-winx64\bin>mysqld --initialiaze--ins ecure mysqld: Can't change dir to 'C:\Users\Administrator\Desktop\mysql-5.7.28-winx64\ data\' (Errcode: 2 - No such file or directory) 2025-03-13T03:35:29.880000Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see doc umentation for more details). 2025-03-13T03:35:29.881000Z 0 [Note] --secure-file-priv is set to NULL. Operatio ns related to importing and exporting data are disabled 2025-03-13T03:35:29.883000Z 0 [Note] mysqld (mysqld 5.7.28) starting as process 6528 ... 2025-03-13T03:35:29.950000Z 0 [Warning] Can't create test file C:\Users\Administ rator\Desktop\mysql-5.7.28-winx64\data\Win7-2022FUQMIO.lower-test 2025-03-13T03:35:29.950000Z 0 [Warning] Can't create test file C:\Users\Administ rator\Desktop\mysql-5.7.28-winx64\data\Win7-2022FUQMIO.lower-test 2025-03-13T03:35:29.951000Z 0 [ERROR] failed to set datadir to C:\Users\Administ rator\Desktop\mysql-5.7.28-winx64\data\ 2025-03-13T03:35:29.951000Z 0 [ERROR] Aborting 2025-03-13T03:35:29.951000Z 0 [Note] Binlog end 2025-03-13T03:35:29.953000Z 0 [Note] mysqld: Shutdown complete C:\Users\Administrator\Desktop\mysql-5.7.28-winx64\bin> C:\Users\Administrator\Desktop\mysql-5.7.28-winx64\bin>mysqld --initialiaze--ins ecure C:\Users\Administrator\Desktop\mysql-5.7.28-winx64\bin>mysqld install mysql57 The service already exists! The current server installed: "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql d.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" MySQL57 C:\Users\Administrator\Desktop\mysql-5.7.28-winx64\bin>mysqladmin -uroot passwor d 123456 mysqladmin: [Warning] Using a password on the command line interface can be inse cure. Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety. mysqladmin: You c
最新发布
03-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

枣泥馅

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值