apt install openjdk-17-jdk openjdk-17-jre
java -version
sudo apt install maven -y
mvn -v
apt install mariadb-server
systemctl stop mariadb
nano /etc/mysql/mariadb.conf.d/50-server.cnf
Edit the line with the following content:
bind-address=0.0.0.0
systemctl restart mariadb
sudo mysql -u root
create database database_name;
show databases;
create user 'username'@'%' identified by 'password';
grant all privileges on database_name.* to 'username'@'%';
flush privileges;
netstat -tlpun
mysql -h IP_server -P port_from_netstat -u username -p
use database_name;
source /path/to/projects/projects_db.sql;
show tables;
nano src/main/resources/application.properties
Edit the 3 lines below:
spring.datasource.url=jdbc:mysql://<address_server>:<port>/<database_name>?serverTimezone=UTC
spring.datasource.username=<username>
spring.datasource.password=<password>
mvn install -DskipTests=true
java -jar target/projects-SNAPSHOT.jar
Open browser and check awesome Java app.