You are on page 1of 12

LESSON

12
Lesson 12
More MySQL and phpMyAdmin

• Altering the Structure of My Table


• Making a Backup of MySQL Database
• Dropping a Database
• Restoring My Database from the Backup
• Querying My MySQL
• Displaying the content of My Database
Altering the Structure of Table

To change the structure of the table. Click on Structure tab. Check the field you want to
edit. Select edit icon to edit or the delete Button to delete the field. The Key icon will make
the field be the primary key.

Don’t forget to click save button to update table.


Making a Backup of MySQL Database
Making a Backup of MySQL Database
Select the database to backup then click export
tab. On the left side we see the available export formats.
But the best format to use is SQL (Structured Query
Language). So that in case something absolutely bad
happened then it will be very easy to restore from the
backup if the format of the backup is SQL.

Check the Structure and/or Data to backup. Check


also “Save as File” then click GO button.
Making a Backup of MySQL Database

You should see this dialog box: This dialog box asks you if you want to Save
the file “friends.sql” or Open it using a text editor such as Notepad.

Choose the “Save File” so you’ll be able to save the file which we will use
later on to restore our friends database. Friends.sql is our backup file for our friends
database.
Dropping a Database

• Never tamper with databases created by others. .


Here’s the list of databases you should NEVER MODIFY:
Dropping a Database

Dropping a database involves erasing not only the data but also the
structure of the database. The word “drop” is not the same as “delete” since drop
involves removal of both data and structure while delete involves removal of data
only. Both operations erase the contents of the database but drop does more
than that. Drop is more destructive because it wipes out our database!

To drop Database, Be careful in selecting the database you want to drop


from the list on the left side. Then click on the drop tab.

Click confirm on the confirmation dialog box to complete the deletion of


database.
Restoring My Database from
the Backup
Restoring My Database from the
Backup
Create the database you want to recover.
Just follow the step creating database. Once
the database is created click the Import Tab.

Click the browse button to locate the file


to recover.

Click Go to complete the restoring of


database from the Backup.
Querying My MySQL Database

To search for particular record or set of records, select the table to search
then click Search tab.
Like operator means the word on value criteria is part of the data value.
The % sign is a wildcard. A wildcard is used to replace any number of
characters.

You might also like