Last Modified 5.24.2025
Install MariaDB on Ubuntu
sudo apt install mariadb-server
If the installation is completed without errors, run the security script to restrict access to the server.
sudo mysql_secure_installation
Refer to the following to complete the security settings.
Enter current password for root (enter for none): <just press ENTER> Switch to unix_socket authentication [Y/n] n Change the root password? [Y/n] n Remove anonymous users? [Y/n] Y Disallow root login remotely? [Y/n] Y Remove test database and access to it? [Y/n] Y Reload privilege tables now? [Y/n] Y
How to connect MariaDB server:
sudo mysql
use mysql show tables;
Note: you cannot connect with mysql --user=root --password mysql command.
You can use the MySQL JDBC driver as it is.
<!-- https://mvnrepository.com/artifact/com.mysql/mysql-connector-j --> <dependency> <groupId>com.mysql</groupId> <artifactId>mysql-connector-j</artifactId> <version>9.3.0</version> </dependency>References