从命令提示符启动 mySql 服务器时出错

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19391182/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 19:08:21  来源:igfitidea点击:

Error in Starting mySql server from command prompt

mysql

提问by Sas Beginner

I am new to sql , I installed mysql and I am following the book : Java how to program to connect to mysql

我是 sql 的新手,我安装了 mysql 并且我正在关注这本书:Java 如何编程以连接到 mysql

I am getting the following error. Regarding timestamp.. I understand the reason.. but i am trying to fix "Can't create test file C:\Program Files\MySQL\MySQL Server 5.6\data\Swati-HP.lower-test"

我收到以下错误。关于时间戳..我明白原因..但我正在尝试修复“无法创建测试文件 C:\Program Files\MySQL\MySQL Server 5.6\data\Swati-HP.lower-test”

Please guide me wit respect to this

请指导我对此表示敬意

C:\Users\Swati>mysqld.exe
2013-10-15 13:57:01 0 [Warning] TIMESTAMP with implicit DEFAULT value is depreca
ted. Please use --explicit_defaults_for_timestamp server option (see documentati
on for more details).
2013-10-15 13:57:01 7492 [Warning] Can't create test file C:\Program Files\MySQL
\MySQL Server 5.6\data\Swati-HP.lower-test
2013-10-15 13:57:01 7492 [Warning] Can't create test file C:\Program Files\MySQL
\MySQL Server 5.6\data\Swati-HP.lower-test
2013-10-15 13:57:01 7492 [Note] Plugin 'FEDERATED' is disabled.
2013-10-15 13:57:01 7492 [Note] InnoDB: The InnoDB memory heap is disabled
2013-10-15 13:57:01 7492 [Note] InnoDB: Mutexes and rw_locks use Windows interlo
cked functions
2013-10-15 13:57:01 7492 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-10-15 13:57:01 7492 [Note] InnoDB: Not using CPU crc32 instructions
2013-10-15 13:57:01 7492 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-10-15 13:57:01 7492 [Note] InnoDB: Completed initialization of buffer pool
2013-10-15 13:57:01 7492 [ERROR] InnoDB: .\ibdata1 can't be opened in read-write
 mode
2013-10-15 13:57:01 7492 [ERROR] InnoDB: The system tablespace must be writable!

2013-10-15 13:57:01 7492 [ERROR] Plugin 'InnoDB' init function returned error.
2013-10-15 13:57:01 7492 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGIN
E failed.
2013-10-15 13:57:01 7492 [ERROR] Unknown/unsupported storage engine: InnoDB
2013-10-15 13:57:01 7492 [ERROR] Aborting

2013-10-15 13:57:01 7492 [Note] Binlog end
2013-10-15 13:57:01 7492 [Note] Shutting down plugin 'partition'
.
.
.
.
.
2013-10-15 13:57:01 7492 [Note] mysqld.exe: Shutdown complete

采纳答案by I?ya Bursov

Folder "program files" in windows is usually restrict write for non-admin accounts, so you can either:

Windows 中的文件夹“程序文件”通常限制非管理员帐户的写入,因此您可以:

  1. run mysql under admin account - not very good practice
  2. set write rights for this folder for all - not very good practice
  3. move data storage into another place and change my.cnf appropriately - right one
  1. 在管理员帐户下运行 mysql - 不是很好的做法
  2. 为所有人设置此文件夹的写权限 - 不是很好的做法
  3. 将数据存储移动到另一个地方并适当地更改 my.cnf - 正确的

回答by Arthur

The same error can also happen if mysqld.exeis already running. Just kill the process.

如果mysqld.exe已经在运行,也会发生同样的错误。杀掉进程就好了。

回答by Hett

You need to grant read/write permissions for user SYSTEM

您需要为用户 SYSTEM 授予读/写权限

回答by Himalaya Garg

Open a DOS prompt and go to the MySQL bin\ directory and issue the below command to know what is causing the issue:

打开 DOS 提示符并转到 MySQL bin\ 目录并发出以下命令以了解导致问题的原因:

..\bin > mysqld --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --standalone --console

..\bin > mysqld --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --standalone --console