win10安装mysqld 8.0.13时候报错, mysqld --initialize --console

蔚蓝追风鹅 2018-12-01 05:04:11
D:\mysql-8.0.13-winx64\bin>mysqld --initialize --console
2018-12-01T08:57:50.209734Z 0 [System] [MY-013169] [Server] D:\mysql-8.0.13-winx64\bin\mysqld.exe (mysqld 8.0.13) initializing of server in progress as process 4128
2018-12-01T08:57:50.211323Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2018-12-01T08:57:50.215088Z 0 [ERROR] [MY-013236] [Server] Newly created data directory D:\mysql-8.0.13-winx64\data\ is unusable. You can safely remove it.
2018-12-01T08:57:50.216564Z 0 [ERROR] [MY-010119] [Server] Aborting
2018-12-01T08:57:50.217891Z 0 [System] [MY-010910] [Server] D:\mysql-8.0.13-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.13) MySQL Community Server - GPL.
...全文
12824 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
zanxinshiyao 2020-02-18
  • 打赏
  • 举报
回复
也没有data文件夹啊
zanxinshiyao 2020-02-18
  • 打赏
  • 举报
回复
mysqld: Can't create/write to file 'D:\java\mysql-8.0.19-winx6in\is_writable' (OS errno 2 - No such file or directory)
2020-02-18T05:53:15.240223Z 0 [System] [MY-013169] [Server] D:\java\mysql-8.0.19-winx64\bin\mysqld.exe (mysqld 8.0.19) initializing of server in progress as process 9180
2020-02-18T05:53:15.244347Z 0 [ERROR] [MY-010460] [Server] --initialize specified but the data directory exists and is not writable. Aborting.
2020-02-18T05:53:15.244369Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:\java\mysql-8.0.19-winx6in\ is unusable. You can remove all files that the server added to it.
2020-02-18T05:53:15.266169Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-02-18T05:53:15.269267Z 0 [System] [MY-010910] [Server] D:\java\mysql-8.0.19-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.19) MySQL Community Server - GPL.
这个应该怎么解决啊 求指教

  • 打赏
  • 举报
回复
应该是你的my.ini有问题了,像我刚刚才发现折磨了我半天的东西,其实只是我在改my.ini文件的时候一不小心把注释给去了,导致mysql无法初始化
lgrason 2019-11-17
  • 打赏
  • 举报
回复 1
把 D:\mysql-8.0.13-winx64\data\ 里面的东西删掉,再执行mysqld --initialize
weixin_45501964 2019-10-16
  • 打赏
  • 举报
回复
mysqld: Can't create/write to file 'Disaibao\mysql-8.0.11-winx64\mysql-8.0.11-winx64\data\is_writable' (OS errno 2 - No such file or directory)
2019-10-16T05:59:23.549006Z 0 [System] [MY-013169] [Server] D:\bisaibao\mysql-8.0.11-winx64\mysql-8.0.11-winx64\bin\mysqld.exe (mysqld 8.0.11) initializing of server in progress as process 18064
2019-10-16T05:59:23.549101Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file 'D:\bisaibao\mysql-8.0.11-winx64\mysql-8.0.11-winx64\binisaibao\mysql-8.0.11-winx64\mysql-8.0.11-winx64\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2019-10-16T05:59:23.552782Z 0 [ERROR] [MY-010460] [Server] --initialize specified but the data directory exists and is not writable. Aborting.
2019-10-16T05:59:23.582908Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-10-16T05:59:23.586735Z 0 [System] [MY-010910] [Server] D:\bisaibao\mysql-8.0.11-winx64\mysql-8.0.11-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.11) MySQL Community Server - GPL.
我的要怎么解决阿
「已注销」 2019-10-14
  • 打赏
  • 举报
回复
zou 成功了 感谢
  • 打赏
  • 举报
回复
引用 10 楼 石门美美哒 的回复:
ini配置文件路径配置错误就有这问题。
你到底有没有碰到这个错误啊
  • 打赏
  • 举报
回复 5
只需要把data文件夹删除就好了,对这群人醉了,五花八门
Hi船长 2019-08-28
  • 打赏
  • 举报
回复
ini配置文件路径配置错误就有这问题。
lsh2245448 2019-04-23
  • 打赏
  • 举报
回复
mysqld: Can't create directory 'C:\Program Files\mysql-8.0.15-winx64\data\' (OS errno 13 - Permission denied) 2019-04-23T08:40:54.838393Z 0 [System] [MY-013169] [Server] C:\Program Files\mysql-8.0.15-winx64\bin\mysqld.exe (mysqld 8.0.15) initializing of server in progress as process 9716 2019-04-23T08:40:54.841184Z 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. 2019-04-23T08:40:54.844094Z 0 [ERROR] [MY-013236] [Server] Newly created data directory C:\Program Files\mysql-8.0.15-winx64\data\ is unusable. You can safely remove it. 2019-04-23T08:40:54.864646Z 0 [ERROR] [MY-010119] [Server] Aborting 2019-04-23T08:40:54.864951Z 0 [System] [MY-010910] [Server] C:\Program Files\mysql-8.0.15-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.15) MySQL Community Server - GPL.
lsh2245448 2019-04-23
  • 打赏
  • 举报
回复
mysqld: Can't create directory 'C:\web\mysql-8.0.11\data\' (OS errno 2 - No such file or directory) 2019-04-23T08:36:17.031874Z 0 [System] [MY-013169] [Server] C:\Program Files\mysql-8.0.15-winx64\bin\mysqld.exe (mysqld 8.0.15) initializing of server in progress as process 11704 2019-04-23T08:36:17.032077Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file 'C:\web\mysql-8.0.11\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive. 2019-04-23T08:36:17.033268Z 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. 2019-04-23T08:36:17.036756Z 0 [ERROR] [MY-013236] [Server] Newly created data directory C:\web\mysql-8.0.11\data\ is unusable. You can safely remove it. 2019-04-23T08:36:17.068228Z 0 [ERROR] [MY-010119] [Server] Aborting 2019-04-23T08:36:17.068495Z 0 [System] [MY-010910] [Server] C:\Program Files\mysql-8.0.15-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.15) MySQL Community Server - GPL.
  • 打赏
  • 举报
回复
D:\mysql-8.0.15-winx64\bin>mysqld --initialize --console 2019-04-12T13:14:52.703863Z 0 [System] [MY-013169] [Server] D:\mysql-8.0.15-winx64\bin\mysqld.exe (mysqld 8.0.15) initializing of server in progress as process 15888 2019-04-12T13:14:57.857572Z 0 [ERROR] [MY-000068] [Server] unknown option '--UTF8'. 2019-04-12T13:14:57.857581Z 0 [Warning] [MY-010952] [Server] The privilege system failed to initialize correctly. If you have upgraded your server, make sure you're executing mysql_upgrade to correct the issue. 2019-04-12T13:14:57.857594Z 0 [ERROR] [MY-013236] [Server] Newly created data directory D:\mysql-8.0.15-winx64\Data\ is unusable. You can safely remove it. 2019-04-12T13:14:57.871197Z 0 [ERROR] [MY-010119] [Server] Aborting 2019-04-12T13:14:59.126320Z 0 [System] [MY-010910] [Server] D:\mysql-8.0.15-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.15) MySQL Community Server - GPL. 这个怎么解决啊
ZOUZDC 2018-12-23
  • 打赏
  • 举报
回复
根据我的经验: 你初始化的时候,没有指定配置文件,可能导致,mysql自己去其他地方扫描出了一个my.inf文件或者用默认的配置初始化mysql, 在我测试的时候当配置文件中包含过多的命令的时候或者多个不相关的命令顺序不对的时候就可能初始化失败. 你可以用一下的流程试一下 my.ini文件内容 ``` [mysql] default-character-set=utf8 [mysqld] default-storage-engine=INNODB basedir=D:/WorkProgramFiles/mysql-8.0.13x64 #程序根目录 datadir=F:/ProgramFilesData/mysql-8.0.13x64Data #想要存储数据的文字,不存在则创建,但是该文件中有内容则报错 ``` 在muysql/bin中启动命令行,输入命令 ··· mysqld.exe --defaults-file="D:/WorkProgramFiles/mysql-8.0.13x64/my.ini" --initialize --console ··· 其中"D:/WorkProgramFiles/mysql-8.0.13x64/my.ini"替换为你的my.inf地址 basedir和datadir地址为/
qq_16105853 2018-12-22
  • 打赏
  • 举报
回复
https://blog.csdn.net/m0_37461416/article/details/78680627看看这个
qq_16105853 2018-12-22
  • 打赏
  • 举报
回复
检查下配置文件my.ini里面的basedir和datadir路径有没错~
蔚蓝追风鹅 2018-12-01
  • 打赏
  • 举报
回复
引用 1 楼 学海无涯回头是岸_ 的回复:
datas 文件夹 非空

请问下是data必须新建一个空的目录还是,不用建空目录,不过我都试过了,还是报错呢,报错后data文件夹里就自动生成许多文件了
  • 打赏
  • 举报
回复
datas 文件夹 非空
Mac OS X 10.15 下源码安装 mysql-8.0.20-macos10.15-x86_64 https://my.oschina.net/kinglyphp/blog/4281112 博客地址 下载mysql-8.0.20-macos10.15-x86_64.tar.gz 可以从mysql官网下载,如果比较慢, 从https://download.csdn.net/download/long4512524/12427861 中下载 解压 tar zxvf mysql-8.0.20-macos10.15-x86_64.tar.gz 移动解压后的二进制包到安装目录 sudo mv mysql-8.0.20-macos10.15-x86_64 /usr/local/mysql 在 /usr/local/mysql 目录新建 data目录文件 cd /usr/local/mysql sudo mkdir data 更改 mysql 安装目录所属用户与用户组 cd /usr/local sudo chown -R root:wheel mysql 在启动 mysql 之前,我们先需要指定my.cnf 文件 因为 mysql 5.7 版本开始 my-default.cnf 文件不会自带,需要手动创建。 cd /usr/local/mysql/support-files sudo vi my-default.cnf 在 /usr/local/mysql/support-files 目录下创建 my-default.cnf [mysqld] basedir = /usr/local/mysql datadir = /usr/local/mysql/data port = 3306 socket = /usr/local/mysql/data/mysql.sock log-error = /usr/local/mysql/data/mysqld.log [client] socket=/usr/local/mysql/data/mysql.sock 拷贝my-default.cnf到/etc/my.cnf sudo cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf 初始化 mysqld cd /usr/local/mysql sudo bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data 其中: basedir 是指你的mysql安装在哪儿了。 (具体需要换成你自己的路径) datadir 是指MySQL后续的数据存放在哪儿。(具体需要换成你自己的路径) 注意: 这儿执行完会生成mysql root账号的密码,后面在客户端连接时,5.7版本需要用到,自己别忘了记录下 类似这种: 其中 Wt#GeUu_q2oJ 就是root的密码。 [Note] A temporary password is generated for root@localhost: Wt#GeUu_q2oJ 启动MYSQL cd /usr/local/mysql sudo support-files/mysql.server start 如下: kingly@192 data % cd /usr/local/mysql kingly@192 mysql % sudo support-files/mysql.server start Starting MySQL . SUCCESS! 对应mysqld 启动起来接口 ps aux | grep mysqld 见到如下所示,证明mysql安装成功。 kingly@192 mysql % ps aux | grep mysqld kingly 40915 0.6 0.0 4285708 724 s000 S+ 5:47下午 0:00.00 grep --color=auto mysqld _mysql 40907 0.4 2.1 4907248 350300 s000 S 5:46下午 0:00.95 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/mysqld.log --pid-file=/usr/local/mysql/data/192.168.0.103.pid --socket=/usr/local/mysql/data/mysql.sock --port=3306 使用 之前的记住的 Wt#GeUu_q2oJ的密码,测试mysql的链接情况 /usr/local/mysql/bin/mysql -uroot -P3306 -p kingly@192 bin % /usr/local/mysql/bin/mysql -uroot -P3306 -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.20 Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> 修改root密码,并为 PASSWORD EXPIRE NEVER 永不过期 mysql> alter user 'root'@'localhost' identified by '12345678' PASSWORD EXPIRE NEVER; mysql> flush privileges; mysql> quit; 设置远程访问 允许root用户在任何地方进行远程登录,并具有所有库任何操作权限。 如果出现 提示”Access denied for user ‘root’@’localhost’ (using password: YES)” mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select user,host from user; +------------------+-----------+ | user | host | +------------------+-----------+ | epass | % | | epass | localhost | | mysql.infoschema | localhost | | mysql.session | localhost | | mysql.sys | localhost | | root | localhost | +------------------+-----------+ 6 rows in set (0.00 sec) mysql> 发现root只有本地权限, 那么, 我们需要给root 加上 127.0.0.1,% 还有指定服务器ip访问的权限, 注意: mysql版本8.0.13,在给新用户授权时,发生了变化 如果出现, 不能直接使用 grant all privileges on *.* to root@'%' identified by '12345678'; //给mysql用户分配远程访问权限 会出现, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by "12345678"' at line 1 的错误,原因是新版本mysql版本把将创建账户和赋予权限分开了。 应该如下操作: mysql> use mysql; mysql> create user 'root'@'%' identified by 'password'; mysql> grant all privileges on *.* to 'root'@'%' with grant option; mysql> flush privileges; 如果使用 Navicat连接MySQL Server8.0版本时出现Client does not support authentication protocol requested by server; 解决办法: mysql> use mysql; mysql> alter user 'root'@'localhost' identified with mysql_native_password by '12345678'; mysql> flush privileges; 如上即可。 加入环境变量,编辑 /etc/profile,这样可以在任何地方用mysql命令了 sudo vi ~/.bash_profile 添加 export PATH=$PATH:/usr/local/mysql//bin 使~/.bash_profile环境变量生效 source ~/.bash_profile 这个就可以在 任何地方用 mysql 命令了。 mysql -uroot -p 启动、重启与停止,状态 启动 sudo /usr/local/mysql/support-files/mysql.server start 重启 sudo /usr/local/mysql/support-files/mysql.server restart 停止 sudo /usr/local/mysql/support-files/mysql.server stop 查看状态 sudo /usr/local/mysql/support-files/mysql.server status

56,678

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧