连接失败到Mysql - ERROR 1045 - Windows 8

时间:2013-11-25 11:39:22

标签: mysql windows

我确定我有正确的密码。当我重新启动我的PC时,即使从命令提示符也无法连接到MYSQLn。

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

这可能是WIN 8的问题吗?

更新

即使我已经使用了该命令行(在XP上运行

mysqld --defaults-file="C:/Program Files/MySQL/MySQL Server 5.6/my-default.ini" --init-file="C:\config/init.txt"

但徒劳无功,

init.txt的内容是:

UPDATE mysql.user SET Password=PASSWORD('123') WHERE User='root';
FLUSH PRIVILEGES;

日志输出为:

2013-11-25 14:46:10 0 [Warning] TIMESTAMP with implicit DEFAULT value is depreca
ted. Please use --explicit_defaults_for_timestamp server option (see documentati
on for more details).
2013-11-25 14:46:10 3288 [Warning] Can't create test file C:\Program Files\MySQL
\MySQL Server 5.6\data\SFC-Laptop.lower-test
2013-11-25 14:46:10 3288 [Warning] Can't create test file C:\Program Files\MySQL
\MySQL Server 5.6\data\SFC-Laptop.lower-test
2013-11-25 14:46:10 3288 [Note] Plugin 'FEDERATED' is disabled.
2013-11-25 14:46:10 3288 [Note] InnoDB: The InnoDB memory heap is disabled
2013-11-25 14:46:10 3288 [Note] InnoDB: Mutexes and rw_locks use Windows interlo
cked functions
2013-11-25 14:46:10 3288 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-11-25 14:46:10 3288 [Note] InnoDB: Not using CPU crc32 instructions
2013-11-25 14:46:10 3288 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-11-25 14:46:10 3288 [Note] InnoDB: Completed initialization of buffer pool
2013-11-25 14:46:10 3288 [ERROR] InnoDB: .\ibdata1 can't be opened in read-write
 mode
2013-11-25 14:46:10 3288 [ERROR] InnoDB: The system tablespace must be writable!

2013-11-25 14:46:10 3288 [ERROR] Plugin 'InnoDB' init function returned error.
2013-11-25 14:46:10 3288 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGIN
E failed.
2013-11-25 14:46:10 3288 [ERROR] Unknown/unsupported storage engine: InnoDB
2013-11-25 14:46:10 3288 [ERROR] Aborting

2013-11-25 14:46:10 3288 [Note] Binlog end
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'partition'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD
'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_METRICS'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET
'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_CMPMEM'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_CMP'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_LOCKS'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'INNODB_TRX'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'BLACKHOLE'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'ARCHIVE'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'MRG_MYISAM'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'MyISAM'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'MEMORY'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'CSV'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'sha256_password'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'mysql_old_password'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'mysql_native_password'
2013-11-25 14:46:10 3288 [Note] Shutting down plugin 'binlog'
2013-11-25 14:46:10 3288 [Note] mysqld: Shutdown complete

更新

ping也可以正常工作

1 个答案:

答案 0 :(得分:1)

您显然正在关注MySQL手册中的How to Reset the Root Password章节,这是一个好主意。但是你的日志表明MySQL无法编写自己的文件:

  

InnoDB:系统表空间必须是可写的!

问题在于手册仍未提及用户帐户控制(UAC),这是Windows Vista在2007年左右推出的一种安全机制。即使您的用户是管理员,您也需要在需要时明确授予管理权限。

我不知道在Windows 8中是什么样的,但在Windows 7中,您需要在“开始”菜单中找到“命令提示符”图标,右键单击它并选择“以管理员身份运行”:

Run elevated command prompt

这称为提升命令提示符。