Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7208

mysqldump incorrectly reads the variable "database" as "databases"

    Details

      Description

      Putting a "database=some_db" (where some_db is a valid database) under the [client] section of ~/.my.cnf (or any other config files parsed by mysqldump) will result on this warning on the execution of mysqldump, even if a database (or several) are specified for the dump :

      $ mysqldump --help                                                                                                   
      Warning: mysqldump: ignoring option '--databases' due to invalid value 'valid_db'
      mysqldump  Ver 10.14 Distrib 5.5.40-MariaDB, for debian-linux-gnu (i686)
      Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
      [...]

      $ mysqldump valid_db                                                                                                
      Warning: mysqldump: ignoring option '--databases' due to invalid value 'valid_db'
      -- MySQL dump 10.14  Distrib 5.5.40-MariaDB, for debian-linux-gnu (i686)
      --
      -- Host: localhost    Database: valid_db
      [...]

      The same happens when running "mysqldump --databases some_db"

      The error message is confusing as the specified database name is valid.

      The upstream bug (http://bugs.mysql.com/bug.php?id=18209) has been reported almost a decade ago and a patch that added the specific option "database" to mysqldump has been provided on the bug report but never made it to the main tree : http://lists.mysql.com/commits/6311

      Another solution would be to make simply that mysqldump doesnt read the database parameter from the config file which would be safe as it should have never worked before.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jb-boin Jean Weisbuch
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: