mysqld:无法将dir更改为data.服务器无法启动 [英] mysqld: Can't change dir to data. Server doesn't start

查看:183
本文介绍了mysqld:无法将dir更改为data.服务器无法启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用安装程序安装了一个MySQL服务器,然后它启动了.重新启动后,我尝试再次启动它并得到错误:

D:\Program Files\MySQL\MySQL Server 5.7\bin>mysqld -u root -p
mysqld: Can't change dir to 'D:\Program Files\MySQL\MySQL Server 5.7\data\'     (Errcode: 2 - No such file or directory)
2015-11-17T08:30:18.822962Z 0 [Warning] TIMESTAMP with implicit DEFAULT     value is deprecated. Please use --explicit_defaults_for_timestamp server option     (see documentation for more details).
2015-11-17T08:30:18.822962Z 0 [Warning] Insecure configuration for --secure-    file    -priv: Current value does not restrict location of generated files.     Consider setting it to a valid, non-empty path.
2015-11-17T08:30:18.822962Z 0 [Note] mysqld (mysqld 5.7.9) starting as     process 1108 ...
2015-11-17T08:30:18.838586Z 0 [Warning] Can't create test file D:\Program     Files\MySQL\MySQL Server 5.7\data\DESKTOP-RNBR3E8.lower-test
2015-11-17T08:30:18.838586Z 0 [Warning] Can't create test file D:\Program     Files\MySQL\MySQL Server 5.7\data\DESKTOP-RNBR3E8.lower-test
2015-11-17T08:30:18.838586Z 0 [ERROR] failed to set datadir to D:\Program     Files\MySQL\MySQL Server 5.7\data\
2015-11-17T08:30:18.838586Z 0 [ERROR] Aborting


2015-11-17T08:30:18.838586Z 0 [Note] Binlog end
2015-11-17T08:30:18.838586Z 0 [Note] mysqld: Shutdown complete

我尝试重新安装MySQL.
更新:
当我以管理员身份运行mysqld -u root -p时,什么都没有发生.

解决方案

自从您使用Windows安装程序以来,所有设置都可以让您将MySQL 5.7作为Windows服务运行,在大多数情况下,这是一个不错的选择.

代替从命令行运行mysqld.exe

  1. Win + R
  2. 运行services.msc
  3. 右键单击MySQL57
  4. 启动服务.

I installed a MySQL server with installer and it started. After reboot I tried to start it again and get the error:

D:\Program Files\MySQL\MySQL Server 5.7\bin>mysqld -u root -p
mysqld: Can't change dir to 'D:\Program Files\MySQL\MySQL Server 5.7\data\'     (Errcode: 2 - No such file or directory)
2015-11-17T08:30:18.822962Z 0 [Warning] TIMESTAMP with implicit DEFAULT     value is deprecated. Please use --explicit_defaults_for_timestamp server option     (see documentation for more details).
2015-11-17T08:30:18.822962Z 0 [Warning] Insecure configuration for --secure-    file    -priv: Current value does not restrict location of generated files.     Consider setting it to a valid, non-empty path.
2015-11-17T08:30:18.822962Z 0 [Note] mysqld (mysqld 5.7.9) starting as     process 1108 ...
2015-11-17T08:30:18.838586Z 0 [Warning] Can't create test file D:\Program     Files\MySQL\MySQL Server 5.7\data\DESKTOP-RNBR3E8.lower-test
2015-11-17T08:30:18.838586Z 0 [Warning] Can't create test file D:\Program     Files\MySQL\MySQL Server 5.7\data\DESKTOP-RNBR3E8.lower-test
2015-11-17T08:30:18.838586Z 0 [ERROR] failed to set datadir to D:\Program     Files\MySQL\MySQL Server 5.7\data\
2015-11-17T08:30:18.838586Z 0 [ERROR] Aborting


2015-11-17T08:30:18.838586Z 0 [Note] Binlog end
2015-11-17T08:30:18.838586Z 0 [Note] mysqld: Shutdown complete

I tried to reinstall MySQL.
UPDATE:
When I run mysqld -u root -p as administrator, nothing happens.

解决方案

Since you used the Windows installer, everything is set up for you to run MySQL 5.7 as a Windows service, which is a great option in most cases.

Instead of running mysqld.exe from the command line,

  1. Win + R
  2. Run services.msc
  3. Right-click on MySQL57
  4. Start the service.

这篇关于mysqld:无法将dir更改为data.服务器无法启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆