0% found this document useful (0 votes)
9 views28 pages

Database Tutorial 1

This document provides a tutorial on setting up a MySQL database using XAMPP, including creating a student database and table, and managing user authentication in phpMyAdmin. It explains the process of inserting data manually and through CSV files, as well as editing records within the database. The tutorial emphasizes the importance of proper file formats and configurations for successful data importation.

Uploaded by

baki220307
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views28 pages

Database Tutorial 1

This document provides a tutorial on setting up a MySQL database using XAMPP, including creating a student database and table, and managing user authentication in phpMyAdmin. It explains the process of inserting data manually and through CSV files, as well as editing records within the database. The tutorial emphasizes the importance of proper file formats and configurations for successful data importation.

Uploaded by

baki220307
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Week 4

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

• Create database “students_system”


• Create table “student_list” and 5 columns.
• Click Go.
• Create a database name “students_system”
Creating a Student Record System • Create table “student_list” with 5 columns
MS Excel for example (comparison to
database)
The file itself is like the database. When we add new worksheet in Excel, it is like we add the tables in our database.
Insert data manually.
Insert data
using SQL
commands.

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)

If you use .xlsx file, it must be converted to .csv


before importing.
• Enable foreign key
checks
• Partial import = 1
• Format = .CSV
• Click Go.
Import has
been
successfull
y finished.
Click
brows
e to
check
data.

You might also like