无法创建测试文件较低的测试启动服务器mysql [英] Can't create test file lower test start server mysql

查看:129
本文介绍了无法创建测试文件较低的测试启动服务器mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在此处创建JDBC编程.我已经按照步骤执行控制台命令来启动服务器:

I'm following this tutorial here on creating a JDBC programming. I've followed the steps up to the console command to start the server:

// For Windows

cd {path-to-mysql-bin}   // Check your MySQL installed directory
mysqld --console

我收到以下错误消息:

mysqld: Can't change dir to 'C:\Program Files\MySQL\MySQL Server 5.7\data\' (Errcode: 2 - No such file or directory)
2017-01-06T10:54:36.968210Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-01-06T10:54:36.968210Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2017-01-06T10:54:36.968210Z 0 [Note] mysqld (mysqld 5.7.17) starting as process 11248 ...
2017-01-06T10:54:36.974226Z 0 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.7\data\DESKTOP-DEQ2IC2.lower-test
2017-01-06T10:54:36.975229Z 0 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.7\data\DESKTOP-DEQ2IC2.lower-test
2017-01-06T10:54:36.975229Z 0 [ERROR] failed to set datadir to C:\Program Files\MySQL\MySQL Server 5.7\data\
2017-01-06T10:54:36.976231Z 0 [ERROR] Aborting

2017-01-06T10:54:36.977234Z 0 [Note] Binlog end
2017-01-06T10:54:36.978237Z 0 [Note] mysqld: Shutdown complete

我对以这种方式使用MySql还是很陌生,但是我可以看到服务器目录中没有数据文件夹,并且我假设没有my.ini文件保存有关数据目录所在位置的配置信息.我还使用Windows安装程序安装了MySql,而我已阅读没有my.ini文件,只有模板my-default.ini文件.

I'm quite new to using MySql in this way but I can see that there is no data folder in the server directory and no my.ini file which I assumes holds the config information on where the data directory is. I've also insntalled MySql using the windows installer which I've read could be why there is no my.ini file and just a template my-default.ini file.

有人知道为什么会这样吗?

Does anyone know why this is happening?

推荐答案

C:\Program Files\MySQL\MySQL Server 8.0.

使用

(ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';) 

用于重置密码的命令(如果需要)

command for password reset (if required)

确保您的文件位于C:驱动器中.根文件夹.

Make sure that your file is in C: drive. root folder.

然后执行以下命令:

C:\> cd "C:\Program Files\MySQL\MySQL Server 8.0\bin"
C:\> mysqld --init-file=C:\\mysql-init.txt

这篇关于无法创建测试文件较低的测试启动服务器mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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