Database Tutorial 1
Database Tutorial 1
Database Tutorial 1
Set-up MySQL Database and Password
Create a Student Database
How does an app or
website work?
• User will open the web browser
• At the browser, text, color,
interaction will be loaded using
HTML, CSS, JavaScript (Client-
based programming/front-end)
• Whatever information will be
displayed or returned to web
browser are from server or
database (that’s where we used
php/mysql
• Back End will return what user
was searching to Front End. Then
the user will see it.
Localhost
Server
• Type localhost or
127.0.0.1 on a web
browser.
• The server has no
password
Create a password in phpMyAdmin
• Open XAMPP
• Click on Apache Config
phpMyAdmin(config.inc.php)
Open config.inc
• Look for Authentication Type
• Under Authentication type,
change “config” to “cookie”
• Save
• Restart XAMPP by clicking
stop, then start
Login using root as a username.
Click on the Change
Password.
• Enter your password
• Click Go
Logout and refresh XAMPP and the
browser.
• Logout
• Restart XAMPP once
again (click stop and
start)
• Type
localhost/phpmyadmin
in the browser
Type localhost/phpmyadmin in
the browser.
• Login with root and the
new password
• It should deny login if
password is null or
incorrect
Wrong or null Successfully
password cannot login. login.
Create database
Remove id
(because it is
set as
AUTO_INCREME
NT) and
added_at
(because it is
the timestamp).
Click Insert.
Two
recor
ds
are
now
adde
d.
When you have more data, you
cannot insert or query one by one.
• We need to create
raw data
• Sometimes you
already have list of
Excel document
• If you do not have,
go to
mockaroo.com and
click download
data.
• Download .CSV
format
MOCK_DATA.csv download
Now, add the
column in the
.csv file first.
• Click on
Structure, then
Add 1 column.
• Click Go.
• Add gender
Add
gender.
Edit gender of previous record.
• Double click
on first
record
gender
• Type the
gender and
press enter
• You can also
click edit to
change.
Import the .csv file. Ensure the format is .csv
Partial
import = 1
(0 if
including
the header)