Skip to main content

Export & Import your SQL Database

Step 1: Get Database Connection Details from Pterodactyl Panel

  1. Log in to Pterodactyl Panel:

    • Login into your account on the panel, if you haven't
  2. Access the Server’s Database:

    • Go to the server where the database is allocated at.
    • Find and click on the "Databases" tab in the left-side menu.

image.png

   3. Copy the Connection Information:

  • Here, you'll see details like the host, port, database name, username, and password for your database. 
  • image.png
  • Copy these details, as you’ll need them to connect with HeidiSQL.

Step 2: Set Up HeidiSQL

  1. Open HeidiSQL:

    • Launch the HeidiSQL application on your computer.
  2. Create a New Session:

    • Click New on the bottom-left side of the program.
    • image.png
  3. Enter Connection Details (obtained on step 2):

    • Under Network Type, select "MySQL (TCP/IP)."
    • For Hostname/IP, paste the host you copied from the Pterodactyl panel.
    • Enter the port number.
    • Enter the username and password from the Pterodactyl database details.
    • For Database, enter the database's name
    • image.png
    • It should look something like the image above
  4. Save and Connect:

    • Click on Save, then Open to connect to the database.
    • If your details are correct, HeidiSQL should connect to the database successfully.

Step 3: Export a Database in HeidiSQL

  1. Select the Database:

    • In HeidiSQL, select the database you want to export from the list on the left.
  2. Export Database:

    • Right-click on the database name, then go to Export Database as SQL.
    • Choose where to save the SQL file and adjust any export settings you need (e.g., data, structure, etc.).
    • Click Export to save the SQL file to your selected location.
    • image.png
    • image.pngimage.png
  3. Check Exported File:

    • Go to the saved location and check that the .sql file was created successfully.

Step 4: Import a Database in HeidiSQL

  1. Select the Target Database:

    • Make sure you are connected to the server and have selected the database you want to import data into. (Step 2, but with the database you want to import data into).
  2. Open SQL File:

    • Click on the File menu in HeidiSQL and select Load SQL file.
    • Locate the .sql file you wish to import and open it.
    • image.png
  3. Execute Import:

    • The SQL commands from the file will load in the SQL Query window. Click Run to execute the commands, which will import the data and structure into the database.
  4. Verify Import:

    • Once the process completes, check the tables and data to ensure everything imported correctly.