initialize specified but the data directory has files in it. Aborting 错误解决

最近学习配置mysql。

1、先按百度的文章https://jingyan.baidu.com/article/f3ad7d0ffc061a09c3345bf0.html  做好基础工作

但是在执行“net start mysql”时,失败了。提示:“mysql 服务无法启动.服务没有报任何错误”

 

2、找到文章https://www.cnblogs.com/wangjunyan/p/5183366.html

为避免链接失效,贴出关键片断(蓝色字体):

     .运行mysqld  --initialize(标题问题所在,若没有init则不存在data目录,自然无法启动成功)

 

3、但是执行“mysqld  --initialize”报错了。提示“initialize specified but the data directory has files in it. Aborting”,大意是提示data目录有文件,搞不定了。。。大胆尝试一下,把mysql安装目录\data文件夹里的内容清空(建议读者备份到其他地方)。再次执行"mysqld  --initialize",没有报错了!

 

4、再次执行net start mysql,服务成功启动!

你可能感兴趣的:(服务器开发)