KB Article #102021

Database password containing $ character

When the database password is changed with a new one containing a $ character (a dollar-sign), parts of the administrative interface of SecureTransport (ST) don't work, and 404 errors can be observed.


Resolution

The presence of the '$' character in the password could lead to ST not being able to process the password string properly and to fail to connect to the database. The issue with the $-character is that it is a special character in some programming languages and treated differently than the literal dollar-sign.


To restore the database password to the default one and be able to access ST, follow the instructions below:


Step #1: Put the MySQL server in "skip-grant-tables" mode, allowing for authentication without a password.


Edit the $FILEDRIVEHOME/conf/mysql.conf file and add the following line before the "bind-address" line:


skip-grant-tables


An example how the configuration will look like:


[mysqld]
## connection settings
skip-grant-tables
bind-address=127.0.0.1
port=33760


Step #2: Remove the database password hash from $FILEDRIVEHOME/conf/configuration.xml


1. Edit the file $FILEDRIVEHOME/conf/configuration.xml.


2. There are several "database" components in the file, all holding the password hash. An example of the main component is below:


<Database databaseType="mysql" host="127.0.0.1" jdbcDriver="com.mysql.jdbc.Driver" jdbcUrl="jdbc:mysql://${host}:${port}/st?user=${user}&password=${password}&characterEncoding=UTF-8&useTimezone=true&serverTimezone=UTC" password="{AES128}cJxPsLF9yUPMTCO7gARTYw==" port="33060" user="root">


3. Remove the password hash ({AES128}cJxPsLF9yUPMTCO7gARTYw== in the example above) from each component, leaving the field blank, as shown below:


<Database ...... password="" ......>


4. Save the changes of configuration.xml


Step #3: Kill all instances of mysqld


Run the following command:


ps -ef | grep mysqld | awk '{print $2}' | xargs kill -9


Step #4: Start the database


$FILEDRIVEHOME/bin/start_db


Step #5: Set a new custom password for the DB


Run the following query against MySQL:


$FILEDRIVEHOME/mysql/bin/mysql --defaults-file=$FILEDRIVEHOME/conf/mysql.conf -uroot mysql -e "update user set Password=PASSWORD('tumbleweed') where User='root'; flush privileges;"


NOTE: $FILEDRIVEHOME denotes the full system path to the installation folder of ST. Before running the command, replace $FILEDRIVEHOME with the actual path


Step #6: Clean up


Delete the skip-grant-tables line added in step 1.


Stop all ST services and then start them.