Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
664 views
in Technique[技术] by (71.8m points)

mysql - mysqld: Can't change dir to data. Server doesn't start

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

D:Program FilesMySQLMySQL Server 5.7in>mysqld -u root -p
mysqld: Can't change dir to 'D:Program FilesMySQLMySQL Server 5.7data'     (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     FilesMySQLMySQL Server 5.7dataDESKTOP-RNBR3E8.lower-test
2015-11-17T08:30:18.838586Z 0 [Warning] Can't create test file D:Program     FilesMySQLMySQL Server 5.7dataDESKTOP-RNBR3E8.lower-test
2015-11-17T08:30:18.838586Z 0 [ERROR] failed to set datadir to D:Program     FilesMySQLMySQL Server 5.7data
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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I have met same problem. In my case I had no ..data dir in my C:mysql so I just executed mysqld --initialize command from c:mysqlin directory and I got the data directory in c:mysqldata. Afterwards I could use mysqld.exe --console command to test the server startup.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...