login as: root

Access denied

root@×××××××'s password:

Last login: Tue Feb 21 03:56:49 2012 from 218.17.162.225

[root@INOTRADE ~]# ps -A

PID TTY          TIME CMD

1 ?        00:00:01 init

1117 ?        00:00:00 udevd

1394 ?        00:00:00 syslogd

1405 ?        00:00:00 sshd

1414 ?        00:00:00 xinetd

1427 ?        00:00:00 couriertcpd

1429 ?        00:00:00 courierlogger

1437 ?        00:00:00 couriertcpd

1439 ?        00:00:00 courierlogger

1445 ?        00:00:00 couriertcpd

1447 ?        00:00:00 courierlogger

1454 ?        00:00:00 couriertcpd

1456 ?        00:00:00 courierlogger

1466 ?        00:00:00 qmail-send

1468 ?        00:00:00 splogger

1469 ?        00:00:00 qmail-lspawn

1470 ?        00:00:00 qmail-rspawn

1471 ?        00:00:00 qmail-clean

1486 ?        00:00:00 httpd

1528 ?        00:00:00 named

1573 ?        00:00:00 mysqld_safe

1623 ?        00:00:00 mysqld

1629 ?        00:00:00 httpd

1655 ?        00:00:00 httpsd

1659 ?        00:00:00 httpsd

1674 ?        00:00:00 crond

1682 ?        00:00:00 saslauthd

1683 ?        00:00:00 saslauthd

1689 ?        00:00:00 sshd

1691 pts/0    00:00:00 bash

1718 pts/0    00:00:00 ps

// 无法登陆,密码正确的,不知道为什么,原来数据库表的访问权限也已经设置了的

[root@INOTRADE ~]# mysql -uroot -p

Enter password:

[root@INOTRADE ~]# ERROR 1045 (28000): Access denied for user ‘admin’@'localhost’ (using password: YES)

[root@INOTRADE ~]# mysql -uroot -p****** -hlocalhost

[root@INOTRADE ~]# ERROR 1045 (28000): Access denied for user ‘admin’@'localhost’ (using password: YES)

// 执行脚本,更新mysql数据库的数据,如用户名密码

[root@INOTRADE ~]# sudo /etc/init.d/mysqld stop

Stopping MySQL:                                            [  OK  ]

[root@INOTRADE ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

[1] 1759

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

[root@INOTRADE ~]# Starting mysqld daemon with databases from /var/lib/mysql

-- 这步可能不会自动执行,等待十几秒后就可以直接回车返回到命令行模式下,然后登录到mysql服务器

[root@INOTRADE ~]#

[root@INOTRADE ~]# mysql -u root mysql

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select  host, user from user;

+-----------+------------------+

| host      | user             |

+-----------+------------------+

| %         | admin            |

| localhost | admin            |

| localhost | horde            |

| localhost | pma_OBBVuV2L3mjn |

+-----------+------------------+

4 rows in set (0.00 sec)

-- 因为我数据库中没有root,换为admin了

mysql> UPDATE user SET Password=PASSWORD('******') where USER='admin';

Query OK, 2 rows affected (0.02 sec)

Rows matched: 2  Changed: 2  Warnings: 0

mysql> FLUSH PRIVILEGES;

Query OK, 0 rows affected (0.02 sec)

mysql> quit;

Bye

[root@INOTRADE ~]# /etc/init.d/mysqld restart

STOPPING server from pid file /var/run/mysqld/mysqld.pid

120221 05:08:02  mysqld ended

Stopping MySQL:                                            [  OK  ]

Starting MySQL:                                            [  OK  ]

[1]+  Done                    mysqld_safe --user=mysql --skip-grant-tables --skip-networking

// 至此, 重启后就可以正常登录了

[root@INOTRADE ~]# mysql -uadmin -p******

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 3

Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;

+-------------------------+

| Database                |

+-------------------------+

| information_schema      |

| *******                 |

| horde                   |

| mysql                   |

+-------------------------+

7 rows in set (0.01 sec)

mysql> use ********;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> show tables;

+------------------------------+

| Tables_in_CQT_AMS            |

+------------------------------+

| T_ALM_APPLICATION            |

| *****************            |

| T_SYS_ROLE                   |

| T_SYS_USER_INFO              |

| T_SYS_USER_ROLE              |

+------------------------------+

22 rows in set (0.00 sec)

mysql> quit

Bye

[root@INOTRADE ~]#

linux mysql 1045 错误_Linux 下,mysql数据库报无法登陆错误:ERROR 1045 (28000): Access denied for use...相关推荐

  1. MariaDB/MySQL 报错解决:ERROR 1698 (28000): Access denied for user 'root'@'localhost'

    我在安装好MariaDB后,发现一个问题:我必须用root用户才能登录数据库,普通用户不能登录数据库,会报错: -> % mysql -h localhost -u root -p Enter ...

  2. MySQL连不上:ERROR 1698 (28000): Access denied for user 'root'@'localhost'

    Table of Contents 修改文件:mysqld.cnf 重启mysql 再次连接 修改密码 将密码方式改为常规 今天在linuxmint上安装了一个mysql $ mysql --vers ...

  3. linux mysql远程链接_Linux下mysql实现远程连接

    首先明白一点并不是mysql禁止远程连接,而是MYSQL的账号禁止远程连接.可能觉得我有点咬文嚼字了,不过我感觉分清这点还是很重要的.默认情况下,所有账号都是禁止远程连接的.在安装MYSQL的时候,在 ...

  4. liunx下mysql远程连接_Linux下mysql实现远程连接

    首先明白一点并不是mysql禁止远程连接,而是MYSQL的账号禁止远程连接.可能觉得我有点咬文嚼字了,不过我感觉分清这点还是很重要的.默认情况下,所有账号都是禁止远程连接的.在安装MYSQL的时候,在 ...

  5. linux mysql 装哪里_linux 下 mysql 安装目录在哪里

    linux 下 mysql 安装目录在哪里.linux mysql 安装介绍: linux 服务器 RedHat 5.0.server. MySQL 版本: 下载地址链接:http://dev.mys ...

  6. linux mysql dump命令_linux下mysql命令

    1.linux下启动mysql的命令: mysqladmin start /ect/init.d/mysql start (前面为mysql的安装路径) 2.linux下重启mysql的命令: mys ...

  7. linux mysql 端口号_linux下mysql 查看默认端口号与修改端口号方法

    一.查看默认端口号 1.登录mysql [root@localhost ~]# mysql -uroot -p Enter password: 输入数据库密码: 2.使用show global var ...

  8. linux下mysql的备份_Linux下MySQL的备份与还原

    Linux下MySQL的备份与还原 2.1 备份 [root@localhost ~]# cd /var/lib/mysql (进入到MySQL库目录,根据自己的MySQL的安装情况调整目录) [ro ...

  9. linux下mysql目录结构_linux下mysql安装配置与目录结构

    本节内容: linux下mysql安装与配置.mysql目录结构. 1.准备安装程序(官方网站下载) 服务端:MySQL-server-community-5.1.44-1.rhel4.i386.rp ...

最新文章

  1. HttpClient 中文官方教程----第一章基础知识-只收录,未测试
  2. Python开发【第七篇】: 面向对象和模块补充
  3. 计算机课伤害事故的防范,体育课安全伤害事故的防范与处理
  4. SpringMVC控制器单例和多例
  5. OpenGL网络资源
  6. .NET程序反汇编JustDecompile 开源
  7. 华工计算机学院专硕分数线,2017华南理工大学
  8. 陈纪修老师《数学分析》 第10章:函数项级数 笔记
  9. 计算机考研复试面试常问问题 数据结构篇(下)
  10. vtk世界坐标系与屏幕坐标系的转换
  11. 注册Google的步骤
  12. 阿里云ECS云服务器快照
  13. 高德地图marker事件监听-高德地图marker绑定事件就执行了[解决立即执行]
  14. 文档控件Aspose.words for.java 授权须知
  15. FlowFormer: Transformer结构光流估计
  16. PEST分析顺丰服务需求_顺丰快递网络优化与设计
  17. 趣味题系列:帽子戏法;警察抓逃犯问题 ;史密斯夫妇握手问题
  18. 计算机网络-常用英文简写大全
  19. MATLAB数学建模(四):机器学习
  20. 机房收费系统之简单的逻辑(上)下机费用运算

热门文章

  1. BCH进入广告行业,将会碰撞出什么样的火花
  2. 挪动以太坊:比特币现金的新功能使其成为智能合约竞争者
  3. 一个不定宽高的元素如何在父元素中垂直水平居中
  4. LeetCode-2 Add Two Numbers
  5. mongodb分片扩展架构
  6. 数据库从表中随机选择一行数据
  7. hdu 1046 完数
  8. 关于Uri.Segments 属性的理解
  9. 猜数字游戏:随机键盘录入一个数字,看是否能猜正确
  10. ldap、additional info: no global superior knowledge