Installing SQL Server on an EC2 instance
In this blogpost, let me show you how to install SQL Server on an EC2 instance.
Before hand, I've created an EC2 instance called "SQLServer1" to demonstrate how to install it.
Step 1: Run the command "sudo yum install -y mariadb-server " to install the MySQL daemon.
Step 2: Run the command "sudo systemctl start mariadb " to start the MySQL server.
Step 3: Next, we need to secure the installation by running the command "sudo mysql_secure_installation". It'll ask you to set a root password , set one and answer all the other question by just giving "Y"
Step 4: After that, you can connect to your MySQL server by running the command "mysql -u root -p". It'd prompt you for the root password. Then, you will be on the MySQL shell where you'd execute SQL commands.
Step 5: Type in "show databases" to look at the databases that are there.
Step 6: Let's try creating a database called NewDB by typing in "CREATE DATABASE NewDB"
Step 7: To use that database, type in "USE NewDB"
Step 8: Let's create a user "francis" who can manage the database with the password "francis" by typing in "CREATE USER 'francis'@'localhost' IDENTIFIED BY 'francis';"
Step 9: Let's try granting all the privileges to manage the database NewDB to "francis" by typing in "GRANT ALL PRIVILEGES ON NewDB.* TO 'francis'@'localhost'"
Step 10: To quit the MySQL shell , type in "quit".








Comments
Post a Comment