Knowledgebase

Databases

Player Owned Game Servers

Databases

4 Articles
Learn all about databases with Shockbyte! From MySQL to SFTP, we’ll guide you through setting up and managing databases for your game server, ensuring smooth gameplay and seamless data management every step of the way.

How To Import And Export MySQL Database

MySQL Databases are one of the many ways to store server data, commonly used by plugins. Your Shockbyte server comes with a free MySQL database that can be used to store new or existing data. If you do not have one yet, you can create a MySQL Database by following this tutorial: Creating a MySQL Database --- Logging Into phpMyAdmin Before getting started with this tutorial, log into phpMyAdmin where you can manage your MySQL database by following the steps below. 1. Log into your server control panel. If you own more than one server, select the server on which you want to import your database into. 2. On the left sidebar of your control panel under Server Settings, navigate to Databases. 3. On the Database page, under Admin Link click on Open Database of the Database you wish to log into via phpMyAdmin. 4. Log into your phpMyAdmin account by entering your MySQL Username and Password then click Go. ::ProseNote{title="Important" description="This tutorial assumes you already have an existing exported database\name.sql file. If you do not have one yet, scroll down to the section on Exporting a MySQL Database." appearance="default"} :: Importing a MySQL Database Importing is a very handy way to store existing data from another server into your server's own database. The steps below will show you how to import an existing MySQL database: 1. On your phpMyAdmin page, select the database you want to import data into by clicking on the database name from the left sidebar. 2. Once you've selected the database, click Import found on the top navigation bar. 3. On the import page, click Choose File to browse and select the file from your computer that you would like to import, make sure you have selected SQL under the Format section and then, click Go. 4. If importing is successful, you will be redirected to a page with a message indicating that import was successful along with all the actions executed. You will also see your data tables shown on the left sidebar under the database name. Exporting A MySQL Database If you want to backup of your data or import it into another database, you may do so by exporting your MySQL database. 1. On your phpMyAdmin page, select the database you want to export by clicking on the database name from the left sidebar. 2. Once you've selected the database, click Export found on the top navigation bar. 3. On the Export page, make sure your Export method is set to Quick and the Format is set to SQL and click Go. This will automatically download your database into your computer. If you are familiar with managing MySQL databases, or you only want to choose specific tables to be exported, you may select the Custom export method. That's it! You've successfully exported your MySQL database. The exported SQL file is now ready to be imported into another database or simply be stored as a backup.

Jay Miller
October 26, 2024

How To Import A MySQL Database Backup (.sql File)

If you are moving to Shockbyte from another host or have an existing database you wish to move to our servers, you can follow this guide to import your database backup. You can import a database backup (.sql file) to your server database via PHPMyAdmin, or by a tool such as MySQL Workbench. Alternatively, if you are an advanced user you can also use the MySQL client via command line to connect directly to your database. ::ProseNote{title="Important" description="Before following this guide, you will need a backup file of the database you wish to import, in format." appearance="default"} :: Importing a Database Backup via PHPMyAdmin You will be able to import a database backup using PHPMyAdmin. 1. On the server control panel, navigate to Databases under Server Settings on the left menu. On this page, you will find your database login details (if you don't have a database yet, hit Create Database). 2. Click the Admin link for the database you wish to use. This will take you to the PHPMyAdmin database management panel. 3. Once the PHPMyAdmin page loads, you will see a login form with the PHPMyAdmin logo. Enter your Username and Password from the MySQL Database page to login. 4. Once logged in, select your database on the left hand side. It will be named similar to: . 5. Click "Import" on the menu at the top. 6. You will now see an option to upload a or file. Upload your database backup to this page, then click Go. 7. Once the upload is complete, the database will be imported and everything is complete. Note that there is a file size limit (2MB) and a time limit to upload the file. If your .sql file is larger than the requirements, you will need to connect to your database directly using the method below, rather than the web interface. --- Importing a Database Backup via MySQL Workbench You will be able to import a Database using MySQL Workbench. 1. Download and install the community edition of MySQL Workbench for your operating system. 2. Once you have opened MySQL Workbench, add a new connection by clicking the + button next to MySQL Connections. Alternatively, navigate to Database Manage Connections. 3. Enter a name for the connection and your database login details. These can be found on the server control panel by navigating to Databases under Server Settings on the left menu. If you don't have a database yet, hit Create Database. If you see an error here, it usually means you have entered the details incorrectly. However, if it connects successfully but a warning message is displayed, the warning can usually be safely ignored as long as the connection is working correctly. 4. Once you have entered your details and connected to the database in MySQL Workbench, click Server along on the top bar, then Database Import on the dropdown menu. 5. On the import page, click Import from Self-Contained File and choose the file you wish to import. Then, select your database as the Default Target Schema. 6. Click the Import Progress tab, then select Start Import. 7. Allow the database to be uploaded and imported entirely. The time this takes can range from a few minutes, to several hours depending on the size of the database you're uploading and your internet speed. --- Importing a Database Backup via Command Line This is an advanced method and MySQL Workbench essentially operates with a graphic interface, so we won't explain this in full. However, if you know how to run MySQL via command line, you can input your connection details into this command to import your .sql file: If you're looking for more MySQL guides, you can find them here.

Jay Miller
October 26, 2024

How To Backup Your Server Databases

The best way to ensure that your database files are always safe is to periodically generate backups of them. This way, even if your files are corrupted for any reason, you can still recover your latest backup of them. --- Automatically Backup your Database The recommended way to backup your database is by configuring an automated backup schedule. This will generate a new backup for your database on a scheduled interval, similar to auto-saving in video games! 1. Navigate to the Shockbyte Panel and open your server panel. 2. On the left-hand sidebar, click the Backups tab 3. Click the Database type, then select the database you'd like to backup. (Optional) 4. Give your schedule a name and/or schedule when you'd like the backup to run. 5. Click Set Interval and configure how often a new backup should generate. 6. Click the Schedule Backup or Start Backup button to confirm your new backup schedule. --- Manually Creating a Backup If you would prefer to manually create your database backups, you can do so using the same menu. 1. Navigate to the Shockbyte Panel and open your server panel. 2. On the left-hand sidebar, click the Backups tab (Optional) 3. Give your schedule a name and/or schedule when you'd like the backup to run. 4. Click the Schedule Backup or Start Backup button to confirm your new backup schedule.

Kobe Plane
September 11, 2024

Creating A Database For Your Server

Each Shockbyte server includes access to three databases, which can be created via the Shockbyte Panel. --- How to Create a Database 1. Login to your control panel and navigate to your server. 2. Navigate to the Databases tab from the left-hand menu. 3. Click on Create Database. 4. Enter in a name, and choose your database type, then click Create Database. ::ProseNote{title="Note" description="If you are unsure which database type is right for you, we recommend using MySQL as it is most common." appearance="default"} :: 5. Click on your newly created database to access its credentials and admin panel. Well done! You have now successfully created a database for your server.

Zach Lowery
September 11, 2024
Join Discord