Comment 3 for bug 1705729

Revision history for this message
Maxime de Roucy (mderoucy) wrote :

@evgeniy-patlan I don't really understand what you mean…
datadir should be extracted as mysqld does, so it should be taken from /etc/my.cnf, /etc/mysql/my.cnf and SYSCONFDIR/my.cnf (cf. https://dev.mysql.com/doc/refman/5.7/en/option-files.html) which are the global config files.

This command does that :

  my_print_defaults mysqld

But the rest of the script fail because it doesn't take into account this sentence from the mysql documentation :

  If multiple instances of a given option are found, the last instance takes precedence, with one
  exception: For mysqld, the first instance of the --user option is used as a security precaution,
  to prevent a user specified in an option file from being overridden on the command line.

If the datadir used by the script should be the default one (as you seems to say) why bothering retrieving it from the configuration ? Just use /var/lib/mysql ; as it is the default datadir.

Can you elaborate ?

Regards