/go/mysqlreset sets a new MariaDB root password without needing the old one. Use it when the current password is lost, or when the normal change with mysqlset does not work. It: Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# Set a new root password
/go/mysqlreset 'N3wRootPassw0rd'
Arguments
| Position | Name | Required | Notes |
|---|---|---|---|
| 1 | <password> |
Yes | The new MariaDB root password. Use letters and digits only. See Special characters. |
The command does not check the password’s length or strength.
Examples
# Reset the root password
/go/mysqlreset 'N3wRootPassw0rd'
# Check that the new password works
mariadb -uroot -p'N3wRootPassw0rd' -e "SELECT 1;"
# Check what was written to GoAdmio's configuration
grep DBPass /usr/local/goadmio/include/config/config.php
# Remove the leftover safe-mode output file
rm -f res
Output
On a normal run, one line is printed, whether or not the reset worked:
MySQL ROOT password has been changed successfully.
Everything else the safe-mode server prints is saved to a file named res in the folder you ran the command from.
| Situation | Exit code |
|---|---|
| No argument | 1, no message |
| Any other run | 0 |
Security
[!WARNING]
The new password is stored in plain text in/usr/local/goadmio/include/config/config.phpand in/root/.my.cnf. Passing it as an argument also leaves it in your shell history and briefly in the process list.
The command log, /var/log/go/mysqlreset.log, records only ******** instead of the password. While the safe-mode server is running, anyone with a local login on the server can use the databases without a password. Network connections are disabled during that time.
See the full reference at /go/mysqlreset and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
