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 如何修改pca中的feature函数
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R
  • ¥15 在线请求openmv与pixhawk 实现实时目标跟踪的具体通讯方法