Home > Net >  I cant back up mysql database with mysqldump
I cant back up mysql database with mysqldump

Time:09-27

The main problem is when i try to backup database with:

mysqldump -u root -p foo > /home/backup/backup.foo_db.sql

i get the error:

mysqldump: [ERROR] unknown variable 'database=foo'

and on the other hand when i just write

mysqldump

i get the same error. here is my 'my.cnf' file:

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[client]
database=foo
user=foouser
password=foopassword
default-character-set=utf8

CodePudding user response:

@tealy

Please update your my.cnf file.

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[client]
#database=foo
#user=foouser
#password=foopassword
#default-character-set=utf8

and try to dunp using mysqldump.

  • Related