How to Create, Edit, and Delete Database Using phpMyAdmin

Previously we have discussed how to create a ForeignKey, today we will discuss how to create database using phpMyAdmin, as well as edit and delete it.

Actually all of the database creation, with any tools, done by running the SQL commands, but by using tools, such as phpMyAdmin, will make it easier, because the SQL commands will be automatically created and run by these tools.

I. How to Create Database Using phpMyAdmin

To create database using phpMyAdmin, follow the following steps:

  1. Login into phpMyAdmin, then clicks on the Database tab menu at the top.
  2. On the next page enter the database name and choose a collation. Collation itself is used to specify the character set and the “collation” used by the database. You can leave it as is.

    How to Create Database Using phpMyAdmin

    Character set is a type of character that can be accommodated by the database, while the database collation determines the way of database compares the characters, such as when sorting the data (ascending or descending) or compare characters in a where statement.

    For more details, you can read this article: Character Set and Collation On MySQL

  3. Next, click the create button to create the database.
Note: The database collation will be used as the default collation if the table or column collation is not defined.

II. How to Edit Database Using phpMyAdmin

After we successfully creating a database, later we may want to edit the database. This editing process includes rename the database, copy the database, change the collation, etc. To edit database using phpMyAdmin, follow these steps:

  1. Click database you want to edit
  2. Click the Operations tab menu located at the top side.
  3. Next, choose the operation you want to do. For example, to rename the database, choose the “Rename database” section and enter the new database name. If you want to copy the database, fill parameter in the “Copy Database To” section. Once finished click the “GO” button to execute the sql command.

    How to Edit Database Using phpMyAdmin - Renaming

    NoteMySQL doesn’t have a query to rename the table, to rename it, phpMyAdmin will create a database and tables exactly the same as the old one, and then delete the old database.

    So, be careful if your database contains huge of data, it could happen a situation where the process of making the database and the tables are not completed (not all copied), in such case the data will be lost.

III. How to Delete Database Using phpMyAdmin

Sometimes the database we have created is no longer needed may be due to outdated or replaced with a new database. The steps to delete database using phpMyAdmin are almost the same as before:

  1. Click database you want to edit and then click the Operations tab menu located at the top side.
  2. Click on the “Drop the database (DROP)” link which is on the Remove Database section.

    How to Delete Database Using phpMyAdmin

    A popup window will appear to confirm whether you really want to delete the database. Click Yes to continue

    WARNING: The deletion is permanent, once removed, the database can not be restored, so, be careful.

Deleting Multiple Databases At Once

Furthermore, in some situation, we may want to delete multiple databases, to do so, click the “Server” link located on the breadcrumbs (on top) usually “Server: 127.0.0.1” , and then check the database name you want to remove.

How to Delete Multiple Database Using phpMyAdmin

Once finished, click the “Drop” button

Related Post

Leave a comment

Like Us

Social