Install MySQL Server

1. Install MySQL server:

Following are the steps for the process to install mySQL server on REDHAT7:

Note: In case you use a Mac OS. Follow the instruction in this link

Step 1: Installing MySQL

$ wget
$ sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm

Install mySQL server using the added MySQL yum reporsitories

$ sudo yum install mysql-server

Step 2: Starting MySQL server:

sudo systemctl start mysqld
sudo systemctl status mysqld

Note if the server has successfully started, your final line should look like this:

Nov 06 11:34:15 wisamdev57 systemd[1]: Started MySQL Server.

Step 3: Configure MySQL

Get the temporary password created during the installation:

$ sudo grep 'temporary password' /var/log/mysqld.log

Get the script to change the default password:

$ sudo mysql_secure_installation

Enter the default password that you retrieved from mysqld.log file. Then enter the new password.

Estimated strength of the password: 100 Change the password for root ? (Press y|Y for Yes, any other key for No) :

Enter No because you have already changed the root password.

Step 4: Test MySQL

$ mysqladmin -u root -p version

Enter the new password

Enter password: 
mysqladmin  Ver 8.42 Distrib 5.7.24, for Linux on x86_64
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Server version		5.7.24
Protocol version	10
Connection		Localhost via UNIX socket
UNIX socket		/var/lib/mysql/mysql.sock
Uptime:			5 min 14 sec

Threads: 1  Questions: 11  Slow queries: 0  Opens: 113  Flush tables: 1  Open tables: 106  Queries per second avg: 0.035

This means that your installation has been successful.

2. Create user and database:

a. Create user 'mkaroune':

a.1. Login to MySQL as root:

~> mysql -u root -p
Enter password:

a.2. Type the following command: user: mkaroune password: Mkaroune@77

mysql> GRANT ALL PRIVILEGES ON *.* TO 'mkaroune'@'localhost' IDENTIFIED BY 'Mkaroune@77';

then quit the mysql command

mysql> \q

a.3. Log to MySQL as mkaroune user and enter the created password

then quit the mysql command

~> mysql -u mkaroune  -p
Enter password:

b. Create jeutrollDB databae

mysql> CREATE DATABASE jeutrollDB;

3. Configure database properties in Spring project:

Add these properties to file under the directory Jeutroll/src/main/resources/

spring.datasource.driver-class-name=com.mysql.jdbc.Driver = org.hibernate.dialect.MySQL5Dialect = true

Add a comment