-
Notifications
You must be signed in to change notification settings - Fork 0
/
project-commands
94 lines (47 loc) · 1.76 KB
/
project-commands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#1: Update the Ubuntu Machine:
sudo apt update
#2: Install the Apache2 server
sudo apt install apache2 -y
#3: Go to the html directory:
cd /var/www/html
#4: Check the files in the directory:
ls
#5: Remove the index.html file:
sudo rm index.html
#6: Check the files in the directory:
ls
#7: Create an index.php file:
sudo nano index.php
#8: Install the MySQL Server:
sudo apt install mysql-server -y
#9: Go to the html directory:
cd /var/www/html
#10: Connect to the MySQL Database through EC2 Server:
sudo mysql -h application-database.calupg2c7sxe.ap-south-1.rds.amazonaws.com -u admin -pintel123 (Replace with your database endpoints, username and password)
#11: Show the databases:
show databases
#12: Go inside the intel database;
use intel;
#13: Create a table:
create table data (firstname varchar(20), email varchar(20));
#14: Insert the data into the table:
insert into data values ('AWS', '[email protected]');
#15: Check the data is successfully inserted or not:
select * from data;
#16: Exit from the database:
exit
#17: Open the index.php file
sudo nano index.php
#18: Change the servername and username in these lines:
servername = “Real Database Endpoint (application-database.calupg2c7sxe.ap-south-1.rds.amazonaws.com)”
username = “admin” instead of “intel”.
#19: Add the php repository:
sudo add-apt-repository -y ppa:ondrej/php
#20: Install the PHP And MySQL Client:
sudo apt install php5.6 mysql-client php5.6-mysqli
#21: Connect with the Database:
sudo mysql -h application-database.calupg2c7sxe.ap-south-1.rds.amazonaws.com -u admin -pintel123 (Replace with your database endpoints, username and password)
#22: Go inside the intel database;
use intel;
#23: Check the data is successfully inserted or not:
select * from data;