我有一个包含mysql/mariadb的xampp可移植目录。xampp目录直接位于d:上,所以路径是d:\xampp,mysql是d:\xampp\mysql,我希望将mysql作为windows服务运行,以便在系统启动时自动启动。好吧。
我使用提升的私密性从d:\xampp\mysql\bin运行了以下命令:mysqld --install MySQL defaults-file="d:\xampp\mysql\bin\my.ini",命令成功(Service successfully installed.)
以下命令(以控制台或独立模式启动)也成功:
mysqld --defaults=file-d:\xampp\mysql\bin\my.ini --standalone
mysqld --defaults-file=d:\xampp\mysql\bin\my.ini --console因此,我认为配置文件是正确的。
但是net start MySQL失败了,出现了1067错误。为MySQL服务生成的命令是D:\xampp\mysql\bin\mysqld defaults-file=d:\xampp\mysql\bin\my.ini MySQL,而且没有任何消息也会失败。
对于1067个错误,有许多解决方案。
mysqld -remove MySQL失败,因为MySQL没有运行,因此sc delete MySQL要删除服务注册)我有点迷路了。我唯一能想到的就是许可问题。但是,当服务作为“本地系统”运行时,服务应该能够访问所有的东西。有什么建议吗?
这是在尝试用D:\xampp\mysql\data\name.err启动服务之后日志文件net start MySQL的内容。
2023-05-12 7:52:01 0 [Note] Starting MariaDB 10.4.28-MariaDB source revision c8f2e9a5c0ac5905f28b050b7df5a9ffd914b7e7 as process 11092
2023-05-12 7:52:01 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2023-05-12 7:52:01 0 [Note] InnoDB: Uses event mutexes
2023-05-12 7:52:01 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2023-05-12 7:52:01 0 [Note] InnoDB: Number of pools: 1
2023-05-12 7:52:01 0 [Note] InnoDB: Using SSE2 crc32 instructions
2023-05-12 7:52:01 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2023-05-12 7:52:01 0 [Note] InnoDB: Completed initialization of buffer pool
2023-05-12 7:52:01 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2023-05-12 7:52:01 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-05-12 7:52:01 0 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-05-12 7:52:01 0 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2023-05-12 7:52:01 0 [Note] InnoDB: 10.4.28 started; log sequence number 50709; transaction id 8
2023-05-12 7:52:01 0 [Note] InnoDB: Loading buffer pool(s) from D:\xampp\mysql\data\ib_buffer_pool
2023-05-12 7:52:01 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-05-12 7:52:01 0 [Note] InnoDB: Buffer pool(s) load completed at 230512 7:52:01
D:\xampp\mysql\bin\mysqld: Too many arguments (first extra is 'defaults-file=d:\xampp\mysql\bin\my.ini').
2023-05-12 7:52:01 0 [ERROR] Aborting我的安装命令错误:
rem wrong
mysqld --install MySQL defaults-file="d:\xampp\mysql\bin\my.ini"
rem correct: double-dash prefix for parameter defaults-file
mysqld --install MySQL --defaults-file="d:\xampp\mysql\bin\my.ini"发布于 2023-05-12 07:17:28
现在我注意到,在为服务生成的命令中,缺少了-- error参数,不知道是错误还是实际错误。
无论如何,我也使用xampp并安装我使用的脚本集成的服务,在您的情况下应该是:
D:\xampp\mysql\mysql_installservice.bat因此,尝试删除实际服务,然后运行此脚本。
您还可以通过单击mysql旁边的红色X从xampp控制面板安装
发布于 2023-05-11 15:00:05
您是否只在命令行中安装?您能否检查mysql日志文件和windows事件查看器,如果有更多关于错误的信息,最终来自远程windows pc。
https://serverfault.com/questions/1130919
复制相似问题