Cara Membuat Database dan Tabel MySQL pada phpMyAdmin
3 min read
12 days ago
Published on Aug 22, 2025
This response is partially generated with the help of AI. It may contain inaccuracies.
Table of Contents
Introduction
In this tutorial, you will learn how to create a MySQL database and table using phpMyAdmin. This guide will walk you through the essential steps, including adding, editing, and deleting data in your tables. Understanding how to manage databases is crucial for web development and data management.
Step 1: Access phpMyAdmin
- Open your web browser.
- Navigate to your phpMyAdmin installation, often found at
http://localhost/phpmyadmin
or a similar URL. - Log in with your MySQL credentials (username and password).
Step 2: Create a New Database
- In the phpMyAdmin interface, look for the "Databases" tab at the top.
- Click on the "Databases" tab.
- Enter a name for your new database in the "Create database" field.
- Choose the collation (e.g.,
utf8_general_ci
for standard characters). - Click the "Create" button to finalize the database creation.
Step 3: Create a New Table
- Select your newly created database from the left sidebar.
- In the "Create table" section, enter a name for your table.
- Specify the number of columns you want to create.
- Click the "Go" button to proceed to define the table structure.
Step 3.1: Define Table Columns
- For each column, specify the following:
- Name: The name of the column (e.g.,
id
,name
,email
). - Type: Choose the data type (e.g., INT, VARCHAR, DATE).
- Length/Values: Set the length if applicable (e.g., 255 for VARCHAR).
- Attributes: Choose attributes like
AUTO_INCREMENT
for the primary key. - Null: Decide if the column can be empty (NULL or NOT NULL).
- Default: Set a default value if necessary.
- Name: The name of the column (e.g.,
- Once all columns are defined, click the "Save" button.
Step 4: Insert Data into the Table
- Select the table you just created from the left sidebar.
- Click on the "Insert" tab.
- Fill in the data for each column in the provided fields.
- After entering the data, click the "Go" button to save the entries.
Step 5: Edit Data in the Table
- Select your table and click on the "Browse" tab to view the data.
- Locate the row you want to edit and click the "Edit" link next to it.
- Modify the fields as needed.
- Click the "Go" button to save changes.
Step 6: Delete Data from the Table
- Go back to the "Browse" tab to view your table data.
- Find the row you wish to delete.
- Click the "Delete" link next to that row.
- Confirm the deletion when prompted.
Conclusion
You've now learned how to create a MySQL database and table using phpMyAdmin, as well as how to add, edit, and delete data within your tables. These skills are fundamental for managing databases effectively. As a next step, consider exploring more advanced database operations, such as creating relationships between tables or using SQL queries for data manipulation. If you have any questions, feel free to ask in the comments!