今天在本地安装一个mysql
服务,遇见了两个问题,搞了挺长时间才解决,主要是对mysql报错不太了解,
现在记录一下,防止以后云间同样的问题,不知道怎么解决。
初始化的时候报错:mysqld --initialize-insecure --user=mysql
mysqld: Can't create directory 'D:\mysql\mysql-8.0.17-winx64\data\' (OS errno 2 - No such file or directory)
2021-12-14T06:49:45.127258Z 0 [System] [MY-013169] [Server] D:\mysql\mysql-8.0.27-winx64\bin\mysqld.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:\mysql\mysql-8.0.27-winx64 hare\errmsg.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:\mysql\mysql-8.0.17-winx64\data\DESKTOP-F48M3QT.err' for error logging: Permission denied
2021-12-14T06:49:45.129458Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:\mysql\mysql-8.0.17-winx64\data\ 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:\mysql\mysql-8.0.27-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.27) MySQL Community Server - GPL.
原因:
my.ini
文件路径输入错误,写成了\\
解决方法:
basedir = D:\mysql\mysql-8.0.27-winx64
# 设置mysql数据库的数据的存放目录
datadir = D:\mysql\mysql-8.0.27-winx64\data
安装报错:mysqld --install
Install/Remove of the Service Denied!
原因:
cmd窗口没有以管理员身份打开
解决方法:
以管理员身份打开cmd窗口
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。