Get a great deal now →

How to Create a Database: MySQL, phpMyAdmin, CMD & Excel

cara membuat database

Topic Recommendations

Share Article

Ready To Improve Your Internal Audit Process?

Discover Audithink's full features and choose a pricing plan that works for your audit team. Start audit transformation now!

Table Of Contents

Making database is an important initial step in application development, business data management, and auditing processes. This article provides a practical and professional step-by-step guide to creating a database using several common tools: MySQL (Workbench / SQL), phpMyAdmin, Command Line (CMD), as well as how to setup a simple “database” in Excel for prototyping or migration. After the technical guidance, there are brief best practices and troubleshooting to make your database setup more secure and reliable.

Preparation before creating a database

  • Access / privilege: the user used must have the right CREATE (e.g. admin or root user).
  • Software installed: MySQL/MariaDB server, MySQL Workbench atau phpMyAdmin bila pakai GUI; untuk Excel pastikan versi Office yang mendukung fitur Table.
  • Encoding considerations: use utf8mb4 for full character support (emoji & multi-language).
  • Naming convention: use descriptive names, without spaces, use underscores (shop_online, db_audit).

How to create a database in MySQL — MySQL Workbench (GUI)

  1. Buka MySQL Workbench dan sambungkan ke instance server (create new connection jika perlu).
  2. In the left pane, right-click on the section Schemas → select Create Schema (or create a Database).
  3. Enter database name (e.g. shop_online).
  4. Select Default Collation → select utf8mb4_general_ci or utf8mb4_unicode_ci.
  5. Click Apply → review the SQL that appears → click Apply again to execute → Finish.

Tips: After creating, create a special user (not root) and grant privileges as needed by the application.

How to create a database in MySQL — Using SQL (CREATE DATABASE)

You can create a database directly with SQL commands. Examples:

CREATE DATABASE IF NOT EXISTS toko_online CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

Steps:

  1. Sambung ke MySQL via Workbench atau CLI.
  2. Run command CREATE DATABASE upstairs.
  3. Use USE toko_online; to move to the newly created database.
  4. Create a table with CREATE TABLE after.

Example of creating a simple table:

USE toko_online; CREATE TABLE users ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), email VARCHAR(150) UNIQUE, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );

How to create a database in phpMyAdmin

phpMyAdmin adalah antarmuka web populer untuk MySQL/MariaDB.

Short steps:

  1. Access phpMyAdmin through the browser (eg. http://localhost/phpmyadmin).
  2. Login with a user who has creation rights.
  3. Click tab Databases at the top.
  4. Enter the database name in the column Create database (e.g. db_audit).
  5. Select collation (utf8mb4_general_ci) then click Create.

Note: phpMyAdmin is just a GUI; what happens behind the scenes are the commands CREATE DATABASE on the MySQL server.

How to create a database via CMD / Command Line (MySQL CLI)

Interactive connection

  1. Buka terminal / command prompt.
  2. Connection to MySQL server:
mysql -u root -p
  1. Enter the password, then run:
CREATE DATABASE db_perusahaan CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; SHOW DATABASES;

Non-interactive creation (one line)

On Linux / Windows:

mysql -u root -p -e "CREATE DATABASE db_perusahaan CHARACTER SET utf8mb4;"

(Press Enter and enter the password when prompted.)

Tips troubleshooting: if the connection fails, check whether the service mysqld runs and the port (default 3306) is not blocked firewall.

How to create a Database in Excel

Important note: Excel is not a replacement for DBMS. Use Excel to create an initial data structure or a simple data source before migrating to a real database.

Steps to create a neat structure:

  1. Create header in the first row: use descriptive column names (eg. id, name, e-mail, created_at).
  2. Format as Table: select data → InsertTable. It provides automatic filters and structured references.
  3. Use Data Validation: for columns with limited values (dropdown), validate numbers, dates.
  4. Keep data types: make sure the date column uses the date format, numbers use numbers.
  5. Export for Migration: Save As → CSV (UTF-8) untuk impor ke MySQL atau tools migrasi.

Excel table header example for products:
| id | sku | name | price | stock | created_at |

Example mini tutorial: from CMD to create tables

  1. Connections:
mysql -u root -p
  1. Create database:
CREATE DATABASE toko_online CHARACTER SET utf8mb4; USE toko_online;
  1. Create table products:
CREATE TABLE products ( id INT AUTO_INCREMENT PRIMARY KEY, sku VARCHAR(50) UNIQUE, name VARCHAR(150), price DECIMAL(10,2), stock INT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );
  1. Check:
SHOW TABLES; DESC products;

Best practices saat membuat database

  • Gunakan encoding UTF-8 (utf8mb4) for international compatibility.
  • Create a separate user untuk aplikasi dengan privilege minimum (principle of least privilege).
  • Implement regular backups (mysqldump, snapshot DBaaS) dan uji restore.
  • Gunakan migration scripts (e.g. Flyway, Liquibase, atau migration tools framework) agar skema dapat dikelola versi-nya.
  • Index wise: create an index for frequently searched columns, but don't overdo it as it slows down writing.
  • Document schema and field rules to make it easier for the other team.

Common terms for error handling in databases

  • Permission denied / Access denied Please refer to the user manual )GRANT), use user with CREATE rights.
  • Database does not appear in phpMyAdmin → Refresh, cek user privileges, atau restart service MySQL.
  • Connection failed in CMD → Make sure mysqld runs, checks hosts / ports, firewalls.
  • Masalah karakter (garbled text) → Pastikan collation dan client connection menggunakan utf8mb4.

Closing

Creating databases is a basic but crucial skill for system development and data management. From building via GUI (Workbench / phpMyAdmin), command line, to initial setup in Excel, each method has its place depending on the need: prototyping, rapid administration, or deployment automation.

To support your audit, reporting, and data management processes, Audithink's Comprehensive Features provides solutions that facilitate data integration and database-based audit report generation. If you need help with database creation, data migration, or system integration with Audithink, please visit the Audithink website and contact our team via Contact page - our team is ready to help.

Related Articles

apa itu database
karakteristik big data
what is big data

Find out how the implementation of the audit application can have a positive impact on the company on an ongoing basis.

Consultation on Your Needs