今天在本地windows环境安装一个mysql服务
初始化的时候报错:
代码语言:javascript复制mysqld: Can't create directory 'D:mysqlmysql-8.0.17-winx64data' (OS errno 2 - No such file or directory)
2021-12-14T06:49:45.127258Z 0 [System] [MY-013169] [Server] D:mysqlmysql-8.0.27-winx64binmysqld.exe (mysqld 8.0.27) initializing of server in progress as process 14276
2021-12-14T06:49:45.127335Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file 'D:mysqlmysql-8.0.27-winx64 hareerrmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2021-12-14T06:49:45.127785Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2021-12-14T06:49:45.129040Z 0 [ERROR] [MY-010187] [Server] Could not open file 'D:mysqlmysql-8.0.17-winx64dataDESKTOP-F48M3QT.err' for error logging: Permission denied
2021-12-14T06:49:45.129458Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:mysqlmysql-8.0.17-winx64data is unusable. You can remove all files that the server added to it.
2021-12-14T06:49:45.129562Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-12-14T06:49:45.129697Z 0 [System] [MY-010910] [Server] D:mysqlmysql-8.0.27-winx64binmysqld.exe: Shutdown complete (mysqld 8.0.27) MySQL Community Server - GPL.
初始化命令:
代码语言:javascript复制mysqld --initialize-insecure --user=mysql
原因:
my.ini
文件路径输入错误,写成了
\
。
正确应该为:
代码语言:javascript复制basedir = D:mysqlmysql-8.0.27-winx64
# 设置mysql数据库的数据的存放目录
datadir = D:mysqlmysql-8.0.27-winx64data
安装的时候报错:
安装命令:
代码语言:javascript复制mysqld --install
报错:
代码语言:javascript复制Install/Remove of the Service Denied!
解决方案:
cmd窗口没有以管理员身份打开