Upgrading database without logging in as root

Hello,

I am attempting to perform an upgrade on our RT (4.2.10) to the latest version. I can successfully upgrade the client, however the script for upgrading the DB appears to mandate that it log into the MySQL server as root.

For security purposes, we don’t allow users to edit any MySQL DBs as root if they are not on the MySQL server. The script in this case ought to log into the server as a given user rather root.

Any help in figuring this out is appreciated.

See this config option:

https://docs.bestpractical.com/rt/4.4.4/RT_Config.html#DatabaseAdmin

Also if you run sbin/rt-setup-database --help you can see there are flags you can provide and send the DBA name and password

Thank you for the help!

I have set that DBA flag. I also double checked that the configure file was working properly; the Makefile does indeed reflect my desired configurations. However the script still wants to connect to the MySQL server as root:

In order to create or update your RT database, this script needs to connect to your mysql instance on [server] (port ‘’) as root

Looking in the Makefile, it appears that this DBA flag is not being passed into the upgrade-database script:

upgrade-database: (PERL) -I(LOCAL_LIB_PATH) -I$(RT_LIB_PATH) sbin/rt-setup-database --action upgrade --prompt-for-dba-password

You can provide a dba flag as well, you may also have an enviroment variable set RT_DBA_USER

Setting that user environment variable appears to have fixed my issue. Thanks again for the help.