failed: Access denied for user 'root'@'localhost' (using password: YES) at /usr/bin/innobackupex lin

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
云数据库 RDS PostgreSQL,高可用系列 2核4GB
简介: [root@t1 /]#  <span style="color:#3366ff">innobackupex --user=root --password /mydata/data /tmp/dir/</span><br><br><br> InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy<b
[root@t1 /]#   innobackupex --user=root --password /mydata/data /tmp/dir/


InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.


This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.


Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p


160309 07:09:49  innobackupex: Executing a version check against the server...
160309 07:09:49  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'root'  (using password: YES).
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 3011
main::mysql_connect('abort_on_error', 1) called at /usr/bin/innobackupex line 1551
innobackupex: Error: Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup','root',...) failed: Access denied for user 'root'@'localhost' (using password: YES) at /usr/bin/innobackupex line 2995
160309 07:09:49  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'root'  (using password: YES).
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 3011
main::mysql_connect('abort_on_error', 1) called at /usr/bin/innobackupex line 1570
innobackupex: Error: Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup','root',...) failed: Access denied for user 'root'@'localhost' (using password: YES) at /usr/bin/innobackupex line 2995


[root@t1 /]#  mysqladmin -uroot -p password 'jsb'

Enter password: 
mysqladmin: connect to server at 'localhost' failed

error: 'Access denied for user 'root'@'localhost' (using password: YES)'


解决:


[root@t1 /]# /etc/init.d/mysql stop
-bash: /etc/init.d/mysql: No such file or directory
[root@t1 /]# /etc/init.d/mysqld stop
Shutting down MySQL.... SUCCESS! 
[root@t1 /]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
[1] 12693
[root@t1 /]# 160309 07:11:26 mysqld_safe Logging to '/mydata/data/t1.err'.
160309 07:11:26 mysqld_safe Starting mysqld daemon with databases from /mydata/data


[root@t1 /]# 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.6.10-log MySQL Community Server (GPL)


Copyright (c) 2000, 2013, 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> UPDATE user SET Password=PASSWORD('jsb') where USER='root';
Query OK, 4 rows affected (0.01 sec)
Rows matched: 4  Changed: 4  Warnings: 0


mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)


mysql> quit
Bye

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


Shutting down MySQL..160309 07:12:49 mysqld_safe mysqld from pid file /mydata/data/t1.pid ended
 SUCCESS! 
Starting MySQL. SUCCESS! 
[1]+  Done                    mysqld_safe --user=mysql --skip-grant-tables --skip-networking
[root@t1 /]# mysql -uroot -pjsb
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.10-log MySQL Community Server (GPL)


Copyright (c) 2000, 2013, 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> exit
Bye


相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
MySQL数据库入门学习
本课程通过最流行的开源数据库MySQL带你了解数据库的世界。 &nbsp; 相关的阿里云产品:云数据库RDS MySQL 版 阿里云关系型数据库RDS(Relational Database Service)是一种稳定可靠、可弹性伸缩的在线数据库服务,提供容灾、备份、恢复、迁移等方面的全套解决方案,彻底解决数据库运维的烦恼。 了解产品详情:&nbsp;https://www.aliyun.com/product/rds/mysql&nbsp;
目录
相关文章
|
前端开发 程序员
前端知识笔记(四十四)———为什么要学代码
前端知识笔记(四十四)———为什么要学代码
111 0
|
Kubernetes 调度 Docker
k8s基本概念-2
k8s基本概念
99 0
|
XML 数据采集 测试技术
四、探索Xpath:解析Web页面的利器
四、探索Xpath:解析Web页面的利器
|
Python
Python高级过滤器:掌握filter函数从入门到精通
Python高级过滤器:掌握filter函数从入门到精通
321 0
|
NoSQL 容灾 数据库
一文上手图数据备份恢复工具 NebulaGraph BR
对数据库而言,容灾备份是不可或缺的部分。本文将以 BR 社区版为例,简单介绍 BR 的一些实现细节并通过上手练习来讲述如何使用 BR 进行 NebulaGraph 数据的备份恢复。
483 0
|
NoSQL 关系型数据库 MySQL
利用GDB调试 MSQL(1)
利用GDB调试 MSQL
118 0
利用GDB调试 MSQL(1)
|
设计模式 算法 安全
设计模式的面试题(总结最全面的一篇)
设计模式的面试题(总结最全面的一篇)
328 0
设计模式的面试题(总结最全面的一篇)
|
算法
那么如何了解线性回归的原理和算法呢?
线性回归可以说是机器学习中最基本的问题类型了,这里就对线性回归的原理和算法做一个小结。
714 0
matlab进行离散点的曲线拟合
原文:matlab进行离散点的曲线拟合 ployfit是matlab中基于最小二乘法的多项式拟合函数。最基础的用法如下: C=polyfit(X,Y,N) 其中: X : 需要拟合的点的横坐标 Y:需要拟合的点的纵坐标 N:以N阶多项式进行拟合 C:返回的N+1个拟合系数。
4263 0