Not the answer you need?
Register and ask your own question!

Error - Failed to connect to MySQL server

stevejohnsonstevejohnson EntrantInactive User Role Beginner
Hi,
I have been trying to use the XtraBackup to perform backup on my Percona server (5.5). I'm using Ubuntu 14.04 LTS.
When i run this command - xtrabackup --backup --datadir=/var/lib/mysql/ --target-dir=/
data/backups/mysql/

..i get the following error.
[email protected]:~# xtrabackup --backup --datadir=/var/lib/mysql/ --target-dir=/
data/backups/mysql/
160218 14:57:16 version_check Connecting to MySQL server with DSN 'dbi:mysql:;m
ysql_read_default_group=xtrabackup;port=3306;mysql_socket=/var/run/mysqld/mysqld
.sock' as 'mysql' (using password: NO).
Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtraba
ckup;port=3306;mysql_socket=/var/run/mysqld/mysqld.sock','mysql',...) failed: Ac
cess denied for user 'mysql'@'localhost' (using password: NO) at - line 1314.
160218 14:57:16 Connecting to MySQL server host: localhost, user: mysql, passwor
d: not set, port: 3306, socket: /var/run/mysqld/mysqld.sock
Failed to connect to MySQL server: Access denied for user 'mysql'@'localhost' (u
sing password: NO).

Any ideas?
Thanks.

Comments

  • apple0315apple0315 Entrant Current User Role Beginner
    You need to use --user=username --password=password to pass credential
  • stevejohnsonstevejohnson Entrant Inactive User Role Beginner
    ..thanks, works perfect now!
  • MkdbaeasyMkdbaeasy Entrant Current User Role Beginner
    Hi I'm new to mysql and am trying to follow this approach here is the error am getting:

    [email protected]# innobackupex --user=bkuser --password=wxcvter --no-timestamp /data/backups/new_backup
    161011 02:14:38 innobackupex: Starting the backup operation

    IMPORTANT: Please check that the backup run completes successfully.
    At the end of a successful backup run innobackupex
    prints "completed OK!".

    161011 02:14:39 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'bkuser' (using password: YES).
    161011 02:14:39 version_check Connected to MySQL server
    161011 02:14:39 version_check Executing a version check against the server...
    161011 02:14:40 version_check Done.
    161011 02:14:40 Connecting to MySQL server host: localhost, user: bkuser, password: set, port: 0, socket: (null)
    Failed to connect to MySQL server: Can't connect to local MySQL server through socket '/tmp/mysql.sock' ( 2).

    Any help or suggestions would be appreciated.

    Thanks
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.