Skip to content

digitalleks/MySQL-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

MySQL-Project

Project 5

The project started with the creation of 2 Linux instance on AWS: mysql server and mysql client. See the snapshot of the two instances here.

Next is the installation of MySQL Server as shown below: On the MySQL Server Instance, run the following set of commands to install the MySQL server package -

sudo apt update
sudo apt install mysql-server

After the server installation, the MySQL service is started using the comand below:

sudo systemctl start mysql.service

Server Status shown here.

Following the server installation is the running of DBMS security script to change the default security settings:

sudo mysql_secure_installation

The root account password was changed from default and confirmed with the new password.

mysql -u root -p

The mySQL server was connected using the root as shown here.

Another user was created on the MySQLserver using the command below after connecing as root:

CREATE USER 'lekan'@'localhost' IDENTIFIED BY 'password';

Note the 'password' indicated was changed to a strong password to comply with the password policy.

Test the mysql instance using the new user:

sudo mysqladmin -p -u lekan version

MYSQL-SERVER-TEST
mysql-server-version

Next is the Installation of the client using the command below on the mysql client instance:

sudo apt install mysql-client -y

Check the client version to verify if the installation was successful:

mysql -V

Output:
mysql-client

In order to connect to the MYSQL Server instance, port 3306 was opened on the EC2 instance security group: Server-Inbound-port1

Next the server is edited to allow connection from remote host by changing the config file as follow:

sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf

allow-remote

In addition to the above, the database user must be allowed to connect to the host server by running the following commands on the MYSQL Server:

 sudo mysql  -u root -p
GRANT ALL PRIVILEGES ON *.* to 'lekan'@'172.31.27.181';
FLUSH PRIVILEGES;

And the host allowed for the user is confirmed by:

SELECT host FROM mysql.user WHERE user = "lekan";

Allow-user-host

The connection is now tested from the client to the server using the mysql utility as follow:

mysql -u lekan -p -h 172.31.27.181

access-test-from-mysql-tool\

DB-Show

About

Project 5

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published