切换设备,下载了免安装版本Mysql,启动服务时报错,报错内容如下
安装网上搜配置步骤,其中一步是Mysql目录下手动新建data文件夹,报错很明显是找不到对应目录。data目录下生成了错误日志如下:
2018-10-18T06:36:39.242333Z 0 [System] [MY-010910] [Server] D:\mysql\bin\mysqld: Shutdown complete (mysqld 8.0.12) MySQL Community Server - GPL.
2018-10-18T06:41:52.515252Z 0 [System] [MY-010116] [Server] D:\mysql\bin\mysqld (mysqld 8.0.12) starting as process 10784
2018-10-18T06:41:52.616257Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2018-10-18T06:41:52.617257Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2018-10-18T06:41:52.618257Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-10-18T06:41:52.619257Z 0 [System] [MY-010910] [Server] D:\mysql\bin\mysqld: Shutdown complete (mysqld 8.0.12) MySQL Community Server - GPL.
解决方案:
进入到Mysql安装目录中的bin目录,然后输入如下命令回车即可:mysqld --initialize-insecure --user=mysql
执行完上面命令后,Mysql会自建一个data文件夹,并且建好默认数据库,登录的用户名为root,密码为空。此时再使用net start mysql就可以启动服务了
|