执行innobackupex --user=root --password=xxxxxx /backup/ 报错如下图

Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup','root' ,...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at - line 1314.
221117 18:07:00 Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: not set
Failed to connect to MySQL server: Can't connect to local MySQL server through socket '/var/ lib/mysql/mysql.sock' (2).
由于服务器同时开启多个实例,导致只输入root和密码是无法执行innobackupex全备份。
解决办法,将--user、--password、--port、--socket都输入齐了,如下命令
[root@MyCentOS backup]# innobackupex --user=root --password=xxxxxx --port=3306 --socket=/tmp/mysql.sock --no-timestamp /backup/full/

本文介绍了一种在执行InnoDB数据库备份过程中遇到的连接失败问题及其解决方案。问题表现为无法通过指定的socket连接到本地MySQL服务器。解决方法是确保在备份命令中完整提供--user、--password、--port和--socket等参数。
3313

被折叠的 条评论
为什么被折叠?



