mysql数据库mysql: [ERROR] unknown option '--skip-grant-tables'
作者:最青松 时间:2024-01-18 08:41:27
mysql数据库报ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)
看到网上说要配置my.ini
我的是win10系统,用的是mysql-5.7.18-winx64mysql
文件里没有my.ini,在网上看到可以自己建,就家加了一个
内容如下:
[mysql]s
kip-grant-tables
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
#设置3306端口
port = 3306
# 设置mysql的安装目录
basedir=C:\Program Files\mysql-5.7.18-winx64
# 设置mysql数据库的数据的存放目录
datadir=C:\Program Files\mysql-5.7.18-winx64\data
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
但是,报错:mysql: [ERROR] unknown option '--skip-grant-tables'
我的mysql是5.0.7, 控制台启动mysql时使用:mysqld --skip-grant-tables
。注意是两根中横线
在网上查到可以执行:mysqld -nt -skip-grant-tables
mysql8.0版本下命令行mysqld -skip-grant-tables 失效 无法登陆问题的解决方法
1、管理员权限登陆cmd,不会使用管理员登陆的请搜索cmd,搜索结果右键。
2、命令行输入:net stop mysql;然后提示。服务停止中 --> 服务已停止,如出现其他错误请百度。
这只是一个示例,请在服务中查看服务具体名称,比如我的就是mysql57。
服务不会打开的请 win+R --> services.msc --> 回车,找到mysql开头的服务名。
3、由于mysqld –skip-grant-tables实测在mysql8.0中已失效,现使用mysqld --console --skip-grant-tables --shared-memory
4、另外开一个cmd,使用mysql直接无密登录。
到这已经可以登录了,先写到这
来源:https://blog.csdn.net/weixin_39357332/article/details/78010643
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
如何用vue实现网页截图你知道吗
![](https://img.aspxhome.com/file/2023/5/133095_0s.png)
MySQL对JSON类型字段数据进行提取和查询的实现
![](https://img.aspxhome.com/file/2023/6/128016_0s.jpg)
Python3.10接入ChatGPT实现逐句回答流式返回
![](https://img.aspxhome.com/file/2023/1/120561_0s.png)
SQL语句检测sp4补丁是否安装
Python 照片人物背景替换的实现方法
![](https://img.aspxhome.com/file/2023/1/100891_0s.png)
使用实现pandas读取csv文件指定的前几行
python数据库编程 Mysql实现通讯录
Python中删除文件的几种方法实例
Python数据可视化Pyecharts库的使用教程
![](https://img.aspxhome.com/file/2023/0/101320_0s.png)
django模板语法学习之include示例详解
SQL Server如何才能访问Sybase中的表
python 异常捕获详解流程
![](https://img.aspxhome.com/file/2023/9/71519_0s.jpg)
go语言实现mqtt协议的实践
![](https://img.aspxhome.com/file/2023/3/134413_0s.png)
python+OpenCV实现图像拼接
![](https://img.aspxhome.com/file/2023/2/113112_0s.jpg)
Qt Quick QML-500行代码实现合成大西瓜游戏
![](https://img.aspxhome.com/file/2023/9/94119_0s.png)
Python pandas的八个生命周期总结
Python读取文件内容为字符串的方法(多种方法详解)
SQL Data Services将成为云中完整的数据库
django框架模板语言使用方法详解
![](https://img.aspxhome.com/file/2023/5/118495_0s.png)