mysqludf/lib_mysqludf_preg

"make installdb" fails if db user has a password

Closed this issue · 1 comments

This happened for me as root, but probably happens for any account that either has a different name than the OS user or that has a database password set.

I looked briefly for a configure option to pass those but didn't see any; I apologize in advance if I completely overlooked something obvious (I'm not very familiar with MySQL, although I am familiar with Oracle).

Steps to reproduce (assuming a machine with a base MySQL install):

  1. Set password on root user
  2. Run ./configure <opts>, make, and 'make install' so that they succeed
  3. Run make installdb
    Failure message:
/usr/bin/mysql  <./uninstalldb.sql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
make: *** [uninstalldb] Error 1

Workaround: run mysql manually and run source installdb.sql.

Thanks for posting this issue.

You can force the installdb target to accept a password with a command like:

    make MYSQL="mysql -p" installdb

The make will default based on the privileges of the user that ran 'configure'. If that user required a password, than the 'make installdb' will require a password. If a different user run configure then 'make installdb', you will see this problem.

I will add a sentence into the INSTALL file with the "mysql -p" suggestion.