Mysql 问题篇 --- Access denied for ERROR 1045 (28000)
2015-07-24 17:58
766 查看
issue: Access denied for ERROR 1045 (28000)
[root@jt30dmz001tc001 ~]# mysql -u root -ppass Access denied for ERROR 1045 (28000):user 'root'@'localhost' (using password: YES) #way 1 #step 1: Start the MySQL server instance or daemon with the --skip-grant-tables option (security setting). mysqld --skip-grant-tables #step 2: $ mysql -u root mysql $mysql> UPDATE user SET Password=PASSWORD('my_password') where USER='root'; $mysql> FLUSH PRIVILEGES; #step 3: $ /etc/init.d/mysql restart ####way 2 [root@jt30dmz001tc001 ~]# mysql -u root -ppass -h 0.0.0.100 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.5.38 MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> mysql> select host, user, password from user; +------------------------------+------+-------------------------------------------+ | host | user | password | +------------------------------+------+-------------------------------------------+ | % | root | *196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7 | | jt30dmz001tc001.qa.webex.com | root | | | 127.0.0.1 | root | | | ::1 | root | | | localhost | root | | | jt30dmz001tc001.qa.webex.com | | | +------------------------------+------+-------------------------------------------+ 6 rows in set (0.00 sec) mysql> update user set password = PASSWORD('pass') where user = 'root' and host = 'localhost'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select host, user, password from user; +------------------------------+------+-------------------------------------------+ | host | user | password | +------------------------------+------+-------------------------------------------+ | % | root | *196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7 | | jt30dmz001tc001.qa.webex.com | root | | | 127.0.0.1 | root | | | ::1 | root | | | localhost | root | *196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7 | | jt30dmz001tc001.qa.webex.com | | | +------------------------------+------+-------------------------------------------+ 6 rows in set (0.00 sec) mysql> commit; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) [root@jt30dmz001tc001 ~]# mysql -u root -ppass Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 Server version: 5.5.38 MySQL Community Server (GPL) Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
相关文章推荐
- MySQL中的integer 数据类型
- MySQL存储过程
- mysql中int、bigint、smallint 和 tinyint的区别与长度
- mysql load data 导出、导入 csv
- source命令执行SQL脚本文件
- linux下mysql添加用户
- mysql procedure
- mysql触发器
- MySQL 备份和恢复策略
- mac下安装mysql(转载)
- mysql 修改编码 Linux/Mac/Unix/通用(杜绝修改后无法启动的情况!)
- MySQL数据的导出、导入(mysql内部命令:mysqldump、mysql)
- mysql数据行转列
- Linux下修改MySQL编码的方法
- MySQL Server 日志
- MySQL 安全事宜
- MySQL 备份与恢复
- MySQL 优化
- MySQL 数据类型