Home arrow Blog arrow MariaDB in Debian Stretch fix for no password

MariaDB in Debian Stretch fix for no password

By default, installing MariaDB in Debian Stretch results in a setup where the system root user can login without a password on the server in question. Root user cannot login at all from anywhere else. You cannot easily change this setup.

To revert to the more traditional setup, login to mysql as root on the server and run this SQL:]

    USE mysql; 

    UPDATE user 
    WHERE user='root';


After that is done, login as root will require the new password you have just set, but it will also be possible to login as root from elsewhere, such as the web. Do use SSL though to protect the password!

#128006 • 12/02/2017 12:12pm by Martin Brampton • Vote: Up votes (291) Down votes (135)