
Mysqldump beschwert sich über Befehlszeilenoptionen, die ich nie angegeben habe. Ich habe weder Shell-Aliase noch einen benutzerdefinierten .my.cnf-Dateisatz. Was mache ich falsch?
Verwenden der --database
Option „Long“:
$ mysqldump --user cloud -p --database cloud > backup.mysqldb
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
Warning: mysqldump: ignoring option '--databases' due to invalid value 'cloud'
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
Verwenden der --databases
Option „Long“:
$ mysqldump --user cloud -p --databases cloud > backup.mysqldb
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
Warning: mysqldump: ignoring option '--databases' due to invalid value 'cloud'
Verwenden der --all-databases
Option „Long“:
$ mysqldump --user cloud -p --all-databases > backup.mysqldb
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
Warning: mysqldump: ignoring option '--databases' due to invalid value 'cloud'
Nur den Datenbanknamen verwenden:
$ mysqldump --user cloud -p cloud > backup.mysqldb
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
Warning: mysqldump: ignoring option '--databases' due to invalid value 'cloud'
Und schließlich die Angabenichts wie auch immer:
$ mysqldump --user cloud -p > backup.mysqldb
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
Warning: mysqldump: ignoring option '--databases' due to invalid value 'cloud'
Antwort1
In Ihrer .my.cnf
Optionsdatei haben Sie wahrscheinlich den Datenbankparameter für alle Clients angegeben, aber mysqldump mag diesen Parameter nicht. Listen Sie diesen Parameter daher nicht für alle Clients in Ihrer Optionsdatei auf.
So habe ich es beispielsweise gelöst, sodass der MySQL-Client auch ohne Angabe der Datenbank funktioniert (standardmäßig der Name „walkin“) und mysqldump keine Probleme verursacht:
Vor:
$ Katze ~/.my.cnf [Klient] Benutzer=root Host = 127.0.0.1 Passwort="root" Datenbank=Walkin
Nach:
$ Katze ~/.my.cnf [Klient] Benutzer=root Host = 127.0.0.1 Passwort="root" [mysql] Datenbank=Walkin