hxqpython 2019-10-21 14:59 采纳率: 0%
浏览 328

【mysql不能登陆root】

mysql无法登陆root:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

查了一下,删掉data文件夹下和数据库无关的文件,在my-default.ini中加上'skip-grant-tables'选项,跳过密码登陆依然失败,加tmpdir路径也不可以;

PS C:\Program Files\MySQL\MySQL Server 5.6\bin> mysqld --skip-grant-tables
2019-10-21 14:48:07 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-10-21 14:48:07 4416 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.6\data\DESKTOP-FVGQVE8.lower-test
2019-10-21 14:48:07 4416 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.6\data\DESKTOP-FVGQVE8.lower-test
2019-10-21 14:48:07 4416 [Note] Plugin 'FEDERATED' is disabled.
2019-10-21 14:48:07 4416 [Note] InnoDB: The InnoDB memory heap is disabled
2019-10-21 14:48:07 4416 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2019-10-21 14:48:07 4416 [Note] InnoDB: Compressed tables use zlib 1.2.3
2019-10-21 14:48:07 4416 [Note] InnoDB: CPU does not support crc32 instructions
2019-10-21 14:48:07 4416 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2019-10-21 14:48:07 4416 [Note] InnoDB: Completed initialization of buffer pool
2019-10-21 14:48:07 32d4  InnoDB: Operating system error number 5 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory. It may also be you have created a subdirectory
InnoDB: of the same name as a data file.
2019-10-21 14:48:07 32d4  InnoDB: File name .\ibdata1
2019-10-21 14:48:07 32d4  InnoDB: File operation call: 'create' returned OS error 105.
2019-10-21 14:48:07 32d4  InnoDB: Cannot continue operation.

这是配置文件:

[mysqld]

explicit_defaults_for_timestamp=true
tmpdir="C:/Program Files/MySQL Server 5.6/temp/"
skip-grant-tables

old_passwords=0
# 设置3306端口

port=3306

# 设置mysql的安装目录

basedir="C:/Program Files/MySQL/MySQL Server 5.6

"# 设置mysql数据库的数据的存放目录

datadir="C:/Program Files/MySQL/MySQL Server 5.6/data

"# 允许最大连接数

max_connections=200

# 允许连接失败的次数

max_connect_errors=10

# 服务端使用的字符集默认为UTF8

character-set-server=utf8

# 创建新表时将使用的默认存储引擎

default-storage-engine=MYISAM
# 默认使用“mysql_native_password”插件认证

#mysql_native_password
default_authentication_plugin=mysql_native_password
[mysql]
# 设置mysql客户端默认字符集

default-character-set=utf8


# 设置mysql客户端连接服务端时默认使用的端口

port=3306

default-character-set=utf8
innodb_buffer_pool_size=32M


innodb_force_recovery = 1

请大神解答这是什么问题?

  • 写回答

3条回答

  • zea_liu 2019-10-21 15:11
    关注

    你的密码是否正确,感觉是密码不正确

    评论

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)