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

  1. Open your web browser.
  2. Navigate to your phpMyAdmin installation, often found at http://localhost/phpmyadmin or a similar URL.
  3. Log in with your MySQL credentials (username and password).

Step 2: Create a New Database

  1. In the phpMyAdmin interface, look for the "Databases" tab at the top.
  2. Click on the "Databases" tab.
  3. Enter a name for your new database in the "Create database" field.
  4. Choose the collation (e.g., utf8_general_ci for standard characters).
  5. Click the "Create" button to finalize the database creation.

Step 3: Create a New Table

  1. Select your newly created database from the left sidebar.
  2. In the "Create table" section, enter a name for your table.
  3. Specify the number of columns you want to create.
  4. Click the "Go" button to proceed to define the table structure.

Step 3.1: Define Table Columns

  1. 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.
  2. Once all columns are defined, click the "Save" button.

Step 4: Insert Data into the Table

  1. Select the table you just created from the left sidebar.
  2. Click on the "Insert" tab.
  3. Fill in the data for each column in the provided fields.
  4. After entering the data, click the "Go" button to save the entries.

Step 5: Edit Data in the Table

  1. Select your table and click on the "Browse" tab to view the data.
  2. Locate the row you want to edit and click the "Edit" link next to it.
  3. Modify the fields as needed.
  4. Click the "Go" button to save changes.

Step 6: Delete Data from the Table

  1. Go back to the "Browse" tab to view your table data.
  2. Find the row you wish to delete.
  3. Click the "Delete" link next to that row.
  4. 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!