mysql ERROR 1045 (28000): Access denied for user
来源:互联网 发布:编程导论 pdf 编辑:程序博客网 时间:2024/06/07 20:55
数据库登录错误,仅限于MySQL Server 5.0。
mysql 5.6没有my.ini文件,有my-default.int文件
C:\Users\Administrator>mysql -uroot -pEnter password:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
编辑mysql配置文件my.ini(MySQL Server 5.0目录下)
最后一行加入 skip-grant-tables
保存退出后重启mysql
重启mysql:
1,服务中(我的电脑-右键-管理-服务和应用程序-服务)。
2,cmd命令行
启动:输入 net stop mysql
停止:输入 net start mysql
cmd里面输入mysql -u root -p就可以不用密码登录了,出现password:的时候直接回车就可以进入。
1.进入mysql数据库:
mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || test |+--------------------+3 rows in set (0.00 sec)mysql> use mysql;Database changedmysql> show tables;+---------------------------+| Tables_in_mysql |+---------------------------+| columns_priv || db || func || help_category || help_keyword || help_relation || help_topic || host || proc || procs_priv || tables_priv || time_zone || time_zone_leap_second || time_zone_name || time_zone_transition || time_zone_transition_type || user |+---------------------------+17 rows in set (0.00 sec)这个时候你可以查看user表中的数据:mysql> select User,Password,host from user;
2,给root用户设置新密码:密码是md5加密的,必须写password()
mysql> update user set password=password(“新密码”) where user=”root”;
Query OK, 1 rows affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
3,刷新数据库
mysql> flush privileges;
4.退出mysql:
mysql> quit
Bye
5,改好之后,再修改一下my.ini这个文件,把我们刚才加入的”skip-grant-tables”这行删除,保存退出再重启mysql就可以了
0 0
- Mysql: ERROR 1045 (28000): Access denied for user
- mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'
- MySQL Error 1045(28000) Access Denied for user 'root'@'localhost'
- mysql笔记: ERROR 1045 (28000): Access denied for user
- Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'
- mysql ERROR 1045 (28000): Access denied for user
- Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'
- MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost'
- mysql ERROR 1045 (28000): Access denied for user解决方法
- MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost'
- mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'
- Mysql ERROR 1045 (28000): Access denied for user '
- 【windows】 mysql ERROR 1045 (28000): Access denied for user解决方法
- mysql ERROR 1045 (28000): Access denied for user解决方法
- mysql ERROR 1045 (28000): Access denied for user解决方法
- mysql ERROR 1045 (28000): Access denied for user解决方法
- mysql ERROR 1045 (28000): Access denied for user解决方法
- mysql ERROR 1045 (28000) Access denied for user解决方法
- 求字符串里面数字之和
- mysql主从同步,超详细,(新手写的所以新手看了就会)
- ping命令
- 1
- SSH—网上商城之商品图片文件上传
- mysql ERROR 1045 (28000): Access denied for user
- Retrofit简单原理分析
- (一)登录 -机房收费系统
- servlet3.1规范: 第15章 与其它规范有关的要求
- node模块发布到npm
- OpenCV access elements by pointer
- MySQL系列第三篇:MySQL工具之SQLYog安装配置
- 自定义 Dialog
- Linux Cpu占用高调试方法