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
utf8mb4for 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)
- Buka MySQL Workbench dan sambungkan ke instance server (create new connection jika perlu).
- In the left pane, right-click on the section Schemas → select Create Schema (or create a Database).
- Enter database name (e.g.
shop_online). - Select Default Collation → select
utf8mb4_general_ciorutf8mb4_unicode_ci. - 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:
- Sambung ke MySQL via Workbench atau CLI.
- Run command
CREATE DATABASEupstairs. - Use
USE toko_online;to move to the newly created database. - Create a table with
CREATE TABLEafter.
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:
- Access phpMyAdmin through the browser (eg.
http://localhost/phpmyadmin). - Login with a user who has creation rights.
- Click tab Databases at the top.
- Enter the database name in the column
Create database(e.g.db_audit). - 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
- Buka terminal / command prompt.
- Connection to MySQL server:
mysql -u root -p- 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
mysqldruns 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:
- Create header in the first row: use descriptive column names (eg.
id,name,e-mail,created_at). - Format as Table: select data →
Insert→Table. It provides automatic filters and structured references. - Use Data Validation: for columns with limited values (dropdown), validate numbers, dates.
- Keep data types: make sure the date column uses the date format, numbers use numbers.
- 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
- Connections:
mysql -u root -p- Create database:
CREATE DATABASE toko_online CHARACTER SET utf8mb4; USE toko_online;- 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 );- 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
mysqldruns, 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.



