Hello,
I installed MariaDB on Debian. Then I ran the following command:
# mariadb-secure-installation
Then I followed the steps as follows:
1- Press Enter to proceed with the default root database user password.
2- Press N and press Enter to enable password authentication when prompted to switch to Unix socket authentication.
3- Press Y and then Enter to change the default root database user password.
4- Press Y and then Enter to remove anonymous users.
5- Disable remote access to the root database user.
6- Remove the default test database.
7- Reload privileges to save changes.
8- Restart the MariaDB service to apply your configuration changes.
I logged into MariaDB and ran the following commands:
# mariadb -u root
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'Passw0rd@1' WITH GRANT OPTION;
MariaDB [(none)]> FLUSH PRIVILEGES;
Then:
# systemctl restart mariadb
# systemctl status mariadb
I got:
May 30 04:49:41 WEB-Server2 mariadbd[162536]: 2025-05-30 4:49:41 0 [Note] Server socket created on IP: '0.0.0.0'.
May 30 04:49:41 WEB-Server2 mariadbd[162536]: 2025-05-30 4:49:41 0 [Note] Server socket created on IP: '::'.
May 30 04:49:41 WEB-Server2 mariadbd[162536]: 2025-05-30 4:49:41 0 [Note] /usr/sbin/mariadbd: ready for connections.
May 30 04:49:41 WEB-Server2 mariadbd[162536]: Version: '10.11.11-MariaDB-0+deb12u1' socket: '/run/mysqld/mysqld.sock' port: 3306 Debian 12
May 30 04:49:41 WEB-Server2 systemd[1]: Started mariadb.service - MariaDB 10.11.11 database server.
May 30 04:49:41 WEB-Server2 /etc/mysql/debian-start[162552]: Upgrading MySQL tables if necessary.
May 30 04:49:41 WEB-Server2 mariadbd[162536]: 2025-05-30 4:49:41 3 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
May 30 04:49:41 WEB-Server2 /etc/mysql/debian-start[162561]: Checking for insecure root accounts.
May 30 04:49:41 WEB-Server2 mariadbd[162536]: 2025-05-30 4:49:41 4 [Warning] Access denied for user 'root'@'localhost' (using password: NO)
May 30 04:49:41 WEB-Server2 debian-start[162564]: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
What is wrong?
Thank you.