See Audithink's Latest Events →

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!

A step-by-step guide to creating a database using MySQL, phpMyAdmin, and the command line, and to organising data in Excel for business and audit needs.
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, and MySQL Workbench or phpMyAdmin if you prefer a GUI; for Excel, make sure you have an Office version that supports Power Query.
  • 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 and connect to the server instance (create a new connection if needed).
  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)

The command to create a database is CREATE DATABASE database_name; — this basic SQL command can be run directly via Workbench, phpMyAdmin, or CLI. A complete example with character settings:

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

Steps:

  1. Connect to MySQL via Workbench or the 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 is a popular web interface for 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 in 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) for import into MySQL or a migration tool.

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

How to Create a Database Online (Cloud / DBaaS)

Besides on a local computer, a database can also be created online through a Database as a Service (DBaaS) service without needing to install your own server. Some popular services: PlanetScale and Amazon RDS (MySQL-compatible), Supabase (PostgreSQL), and MongoDB Atlas (NoSQL).

The general flow is similar across most services:

  1. Sign up for an account on your chosen DBaaS platform.
  2. Create a new database instance/project through the dashboard, choosing the nearest server region.
  3. Copy the connection credentials (host, port, username, password, connection string) provided.
  4. Connect via MySQL Workbench, phpMyAdmin (if supported), or your application using those credentials — creating tables and running queries works the same way as with a local database.

The main advantage of an online database is not having to manage your own server (maintenance, backups, and scaling are handled by the provider), though subscription costs and network latency compared to a local database should be considered.

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 for the application with minimum privileges (principle of least privilege).
  • Implement regular backups (mysqldump, DBaaS snapshots) and test the restore.
  • Gunakan migration scripts (e.g. Flyway, Liquibase, or a migration tools framework) so that the schema can be version-managed.
  • 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, check user privileges, or restart the MySQL service.
  • Connection failed in CMD → Make sure mysqld runs, checks hosts / ports, firewalls.
  • Masalah karakter (garbled text) → Make sure the collation and client connection use utf8mb4.

FAQ About How to Create a Database

What needs to be prepared before creating a database?

Make sure the user has the CREATEprivilege, that software such as MySQL/MariaDB and its GUI are installed, that you use encoding utf8mb4 so multi-language characters are supported, and that you apply a descriptive naming convention without spaces.

What is the command to create a database?

The command to create a database is CREATE DATABASE database_name; in SQL. A complete example with character settings: CREATE DATABASE IF NOT EXISTS database_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;. This command can be run via MySQL Workbench, phpMyAdmin, or CLI/CMD.

How do you create a database through MySQL Workbench?

Connect Workbench to the server instance, right-click the Schemas section and choose Create Schema, enter the database name, select the default collation such as utf8mb4_general_ci, then click Apply to execute the generated SQL.

How do you create a database through phpMyAdmin and the command line?

In phpMyAdmin: open the interface in a browser, log in, go to the Databasestab, enter the database name and collation, then click Create. On the command line: run mysql -u root -p, enter the password, then execute the command CREATE DATABASE — or do it in a single line using the -e.

Can Excel be used as a database?

Excel is not a replacement for a DBMS, but it can be used to lay out the initial data structure before migration. Create descriptive headers, format the range as a Table, use data validation, keep data types consistent, then export to CSV (UTF-8) for import into MySQL.

How do you create a database online?

Sign up for a Database as a Service (DBaaS) provider such as PlanetScale, Amazon RDS, Supabase, or MongoDB Atlas, create a new database instance through the dashboard, then connect your application or tools like Workbench using the provided connection credentials (host, port, username, password). You don't need to manage your own server, but subscription costs and network latency are worth considering.

What best practice when creating a database?

Use encoding utf8mb4, create a separate application user with minimum privileges, run regular backup and test the restoreas well, manage schema versions through a migration script tool such as Flyway or Liquibase, create indexes judiciously, and document the schema for the rest of the team.

Conclusion

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

To support your audit, reporting, and data management processes, Audithink 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.

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

Related Articles

Choosing an AuditBoard Optro alternative
Comparison of Audithink and TeamMate Plus
Comparison of Audithink and Optro AuditBoard