{"id":4419,"date":"2025-09-22T16:36:21","date_gmt":"2025-09-22T09:36:21","guid":{"rendered":"https:\/\/audithink.com\/?p=4419"},"modified":"2025-09-22T16:36:27","modified_gmt":"2025-09-22T09:36:27","slug":"how-to-create-a-database","status":"publish","type":"post","link":"https:\/\/audithink.com\/en\/blog\/cara-membuat-database\/","title":{"rendered":"How to Create a Database: MySQL, phpMyAdmin, CMD &amp; Excel"},"content":{"rendered":"<p>Making <strong><a href=\"https:\/\/audithink.com\/en\/article\/database\/\" data-type=\"post\" data-id=\"4416\">database<\/a><\/strong> 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 \u201cdatabase\u201d 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Preparation before creating a database<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Access \/ privilege<\/strong>: the user used must have the right <code>CREATE<\/code> (e.g. admin or root user).<\/li>\n\n\n\n<li><strong>Software installed<\/strong>: MySQL\/MariaDB server, MySQL Workbench atau phpMyAdmin bila pakai GUI; untuk Excel pastikan versi Office yang mendukung fitur Table.<\/li>\n\n\n\n<li><strong>Encoding considerations<\/strong>: use <code>utf8mb4<\/code> for full character support (emoji &amp; multi-language).<\/li>\n\n\n\n<li><strong>Naming convention<\/strong>: use descriptive names, without spaces, use underscores (<code>shop_online<\/code>, <code>db_audit<\/code>).<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">How to create a database in MySQL \u2014 MySQL Workbench (GUI)<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Buka MySQL Workbench<\/strong> dan sambungkan ke instance server (create new connection jika perlu).<\/li>\n\n\n\n<li>In the left pane, right-click on the section <strong>Schemas<\/strong> \u2192 select <strong>Create Schema<\/strong> (or create a Database).<\/li>\n\n\n\n<li>Enter <strong>database name<\/strong> (e.g. <code>shop_online<\/code>).<\/li>\n\n\n\n<li>Select <strong>Default Collation<\/strong> \u2192 select <code>utf8mb4_general_ci<\/code> or <code>utf8mb4_unicode_ci<\/code>.<\/li>\n\n\n\n<li>Click <strong>Apply<\/strong> \u2192 review the SQL that appears \u2192 click <strong>Apply<\/strong> again to execute \u2192 <strong>Finish<\/strong>.<\/li>\n<\/ol>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong><em>Tips<\/em>:<\/strong> After creating, create a special user (not root) and grant privileges as needed by the application.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">How to create a database in MySQL \u2014 Using SQL (CREATE DATABASE)<\/h2>\n\n\n\n<p>You can create a database directly with SQL commands. Examples:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE DATABASE IF NOT EXISTS toko_online CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;<\/code><\/pre>\n\n\n\n<p>Steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Sambung ke MySQL via Workbench atau CLI.<\/li>\n\n\n\n<li>Run command <code>CREATE DATABASE<\/code> upstairs.<\/li>\n\n\n\n<li>Use <code>USE toko_online;<\/code> to move to the newly created database.<\/li>\n\n\n\n<li>Create a table with <code>CREATE TABLE<\/code> after.<\/li>\n<\/ol>\n\n\n\n<p>Example of creating a simple table:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>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 );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How to create a database in phpMyAdmin<\/h2>\n\n\n\n<p>phpMyAdmin adalah antarmuka web populer untuk MySQL\/MariaDB.<\/p>\n\n\n\n<p>Short steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Access phpMyAdmin through the browser (eg. <code>http:\/\/localhost\/phpmyadmin<\/code>).<\/li>\n\n\n\n<li>Login with a user who has creation rights.<\/li>\n\n\n\n<li>Click tab <strong>Databases<\/strong> at the top.<\/li>\n\n\n\n<li>Enter the database name in the column <code>Create database<\/code> (e.g. <code>db_audit<\/code>).<\/li>\n\n\n\n<li>Select collation (<code>utf8mb4_general_ci<\/code>) then click <strong>Create<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p>Note: phpMyAdmin is just a GUI; what happens behind the scenes are the commands <code>CREATE DATABASE<\/code> on the MySQL server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to create a database via CMD \/ Command Line (MySQL CLI)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Interactive connection<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Buka terminal \/ command prompt.<\/li>\n\n\n\n<li>Connection to MySQL server:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Enter the password, then run:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE DATABASE db_perusahaan CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; SHOW DATABASES;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Non-interactive creation (one line)<\/h3>\n\n\n\n<p>On Linux \/ Windows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p -e \"CREATE DATABASE db_perusahaan CHARACTER SET utf8mb4;\"<\/code><\/pre>\n\n\n\n<p>(Press Enter and enter the password when prompted.)<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong><em>Tips troubleshooting<\/em>:<\/strong> if the connection fails, check whether the service <code>mysqld<\/code> runs and the port (default 3306) is not blocked firewall.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">How to create a Database in Excel<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>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.<\/p>\n<\/blockquote>\n\n\n\n<p>Steps to create a neat structure:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Create header<\/strong> in the first row: use descriptive column names (eg. <code>id<\/code>, <code>name<\/code>, <code>e-mail<\/code>, <code>created_at<\/code>).<\/li>\n\n\n\n<li><strong>Format as Table<\/strong>: select data \u2192 <code>Insert<\/code> \u2192 <code>Table<\/code>. It provides automatic filters and structured references.<\/li>\n\n\n\n<li><strong>Use Data Validation<\/strong>: for columns with limited values (dropdown), validate numbers, dates.<\/li>\n\n\n\n<li><strong>Keep data types<\/strong>: make sure the date column uses the date format, numbers use numbers.<\/li>\n\n\n\n<li><strong>Export for Migration<\/strong>: <code>Save As<\/code> \u2192 CSV (UTF-8) untuk impor ke MySQL atau tools migrasi.<\/li>\n<\/ol>\n\n\n\n<p>Excel table header example for <code>products<\/code>:<br>| id | sku | name | price | stock | created_at |<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Example mini tutorial: from CMD to create tables<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Connections:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Create database:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE DATABASE toko_online CHARACTER SET utf8mb4; USE toko_online;<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Create table <code>products<\/code>:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>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 );<\/code><\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Check:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>SHOW TABLES; DESC products;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Best practices saat membuat database<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Gunakan encoding UTF-8 (utf8mb4)<\/strong> for international compatibility.<\/li>\n\n\n\n<li><strong>Create a separate user<\/strong> untuk aplikasi dengan privilege minimum (principle of least privilege).<\/li>\n\n\n\n<li><strong>Implement regular backups<\/strong> (mysqldump, snapshot DBaaS) dan uji restore.<\/li>\n\n\n\n<li><strong>Gunakan migration scripts<\/strong> (e.g. Flyway, Liquibase, atau migration tools framework) agar skema dapat dikelola versi-nya.<\/li>\n\n\n\n<li><strong>Index wise<\/strong>: create an index for frequently searched columns, but don't overdo it as it slows down writing.<\/li>\n\n\n\n<li><strong>Document schema<\/strong> and field rules to make it easier for the other team.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Common terms for error handling in databases<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Permission denied \/ Access denied<\/strong> Please refer to the user manual )<code>GRANT<\/code>), use user with CREATE rights.<\/li>\n\n\n\n<li><strong>Database does not appear in phpMyAdmin<\/strong> \u2192 Refresh, cek user privileges, atau restart service MySQL.<\/li>\n\n\n\n<li><strong>Connection failed in CMD<\/strong> \u2192 Make sure <code>mysqld<\/code> runs, checks hosts \/ ports, firewalls.<\/li>\n\n\n\n<li><strong>Masalah karakter (garbled text)<\/strong> \u2192 Pastikan collation dan client connection menggunakan <code>utf8mb4<\/code>.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>To support your audit, reporting, and data management processes, <strong><a href=\"https:\/\/audithink.com\/en\/\" data-type=\"page\" data-id=\"794\">Audithink<\/a><\/strong> 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 <strong><a href=\"https:\/\/audithink.com\/en\/contact\/\" data-type=\"page\" data-id=\"2344\">Contact page<\/a><\/strong> - our team is ready to help.<\/p>","protected":false},"excerpt":{"rendered":"<p>Membuat database adalah langkah awal penting dalam pengembangan aplikasi, manajemen data bisnis, dan proses audit. Artikel ini memberikan panduan praktis dan profesional langkah-per-langkah untuk membuat database menggunakan beberapa alat umum: MySQL (Workbench \/ SQL), phpMyAdmin, Command Line (CMD), serta cara menata \u201cdatabase\u201d sederhana di Excel untuk prototyping atau migrasi. Setelah panduan teknis, ada best practice [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4420,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[15],"tags":[28],"class_list":["post-4419","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-software-audit"],"acf":[],"_links":{"self":[{"href":"https:\/\/audithink.com\/en\/wp-json\/wp\/v2\/posts\/4419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/audithink.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/audithink.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/audithink.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/audithink.com\/en\/wp-json\/wp\/v2\/comments?post=4419"}],"version-history":[{"count":1,"href":"https:\/\/audithink.com\/en\/wp-json\/wp\/v2\/posts\/4419\/revisions"}],"predecessor-version":[{"id":4421,"href":"https:\/\/audithink.com\/en\/wp-json\/wp\/v2\/posts\/4419\/revisions\/4421"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/audithink.com\/en\/wp-json\/wp\/v2\/media\/4420"}],"wp:attachment":[{"href":"https:\/\/audithink.com\/en\/wp-json\/wp\/v2\/media?parent=4419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/audithink.com\/en\/wp-json\/wp\/v2\/categories?post=4419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/audithink.com\/en\/wp-json\/wp\/v2\/tags?post=4419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}