How to Create MySQL Database in cPanel Cetak

  • database, mysql
  • 0

How to Create MySQL Database in cPanel

MySQL database is where your website stores its data. If you use WordPress, Joomla, or other web applications that require a database, you must create one before installation. The process is easy and only takes a few minutes.

Steps to Create Database

1. Open MySQL Databases

  1. Login to your Satelitweb cPanel hosting
  2. Find the DATABASES section
  3. Click MySQL Databases

2. Create New Database

  1. In the Create New Database section, type your desired database name
  2. Database name usually gets prefixed with cPanel username, resulting in something like username_dbname
  3. Click Create Database
  4. Confirmation will appear that database was created
  5. Click Go Back to return

3. Create Database User

Database and user are separate. You must create a user before you can access the database.

  1. Scroll to MySQL Users section
  2. In Add New User, type your desired username
  3. Create a strong password. Click Password Generator for automatic generation
  4. Note or save this password as you will need it later
  5. Click Create User

4. Connect User to Database

  1. Scroll to Add User To Database section
  2. Select the newly created user from dropdown
  3. Select the newly created database from dropdown
  4. Click Add
  5. On the privileges page, check ALL PRIVILEGES to give full access
  6. Click Make Changes

Done! Your database is ready to use.

Information to Note Down

After creating the database, note this information as you will need it during application installation:

Database Name: username_dbname
Database User: username_dbuser  
Database Password: the password you created
Database Host: localhost

On Satelitweb hosting, database host is always localhost unless there are special instructions from support team.

Accessing phpMyAdmin

phpMyAdmin is a tool for managing databases through a visual interface. You can view tables, edit data, run SQL queries, import and export databases.

  1. In cPanel, find the DATABASES section
  2. Click phpMyAdmin
  3. Select database in left sidebar
  4. Now you can view and manage database contents

Importing Database

If you are migrating from another hosting or restoring backup, you need to import database:

  1. Open phpMyAdmin
  2. Click target database in left sidebar
  3. Click Import tab in top menu
  4. Click Choose File and select SQL file from computer
  5. Scroll down and click Go
  6. Wait until process completes

Maximum import size via phpMyAdmin is usually around 50MB to 128MB depending on server settings. For larger files, contact Satelitweb support for command line import assistance.

Exporting Database

Export is useful for backup or migrating to another hosting:

  1. Open phpMyAdmin
  2. Click the database you want to export
  3. Click Export tab
  4. Choose Quick for fast export or Custom to configure options
  5. Leave format as SQL
  6. Click Go
  7. SQL file will download

Deleting Database

  1. Open MySQL Databases in cPanel
  2. Scroll to Current Databases section
  3. Find the database you want to delete
  4. Click Delete next to it
  5. Confirm deletion

Be careful, deleted data cannot be recovered. Make sure you have backup before deleting.

Database Security Tips

  • Use strong password minimum 16 characters with combination of letters numbers and symbols
  • Do not use easily guessed database or user names
  • Give minimum required privileges, not always ALL PRIVILEGES
  • Backup database regularly
  • Do not share database information with unauthorized people

Troubleshooting

Error establishing database connection:

  • Check database name, username, and password are correct
  • Make sure user has been added to database
  • Check hostname, usually localhost
  • Make sure database is not empty or corrupt

Cannot create database:

  • May have reached database limit in hosting package
  • Database name might already be in use
  • Contact support for checking

Import failed:

  • File too large, try splitting or ask support for help
  • Wrong file format, must be SQL
  • There are errors in the SQL file

Need more help with databases? Satelitweb technical team can help troubleshoot your database issues. Open a support ticket and attach screenshots of any errors you see.


Was this answer helpful?

« Kembali