How to Import or Export a Database in SWPanel with MySQL Workbench
With SWPanel you can use the phpMyAdmin tool to access the management of your databases, such as exporting or importing them.
Also, you can use any kind of MySQL/MariaDB database management application, such as MySQL Workbench, which allows a much more powerful database management than phpMyAdmin.
Before starting the tutorial, don't you have a Cloud server with Windows operating system? Don't worry! With just one click, you can easily deploy it with SW Hosting.
cta:cloud_so
In this manual we are going to learn how to export and import a SQL file using MySQL Workbench.
Preparing the environment
First of all, it is advisable to have the database already created in your SWPanel. From SW Hosting you have a manual on Create a MySQL or MariaDB database.
danger In case of importing the database from an external provider or from another SWPanel service or account, it is very important that the name, user and password of the Database you have created to import the SQL file are identical to those corresponding to the old service provider.
You will also need to know the following information:
-
Host Name/IP: IP of the database server.
-
User: Username of the database you have previously created.
-
Password: Access key to the database that you have previously created.
-
Port: 3306 (usually).
To find out what is the Host/IP name of your database you must:
- Type in the SWPanel search engine the name of the service in which you want to modify the basic parameters and click on it.
- Click on "Service Servers", located in the blue side menu.
- The IP found in "Assigned DB Server", is the one you should use as "Host Name/IP".
Once you have all the data, we can move on to the next step.
Connection
- To make the connection, you must open the MySQL Workbench program and create a new connection. You can do this by going to "Database" --> "Manage Connections...". Or by clicking on the "+" icon:
- Next, you must enter the data previously collected and then click on "ok":
-
Connection name: Name you want to give to the connection.
-
Hostname: IP address of the database server.
-
Port: 3306
-
Username: User name of the database you have previously created.
- Finally, you must click on the new box that will appear with the connection name. It will ask you for a "password", this corresponds to the access key to the database you have previously created.
Exporting data
You can use the "Data export" panel to export MySQL data.
-
In MySQL Workbench, in the "Navigator " panel, select "Data export".
-
In the "Data export" panel, select each database you want to export.
-
For each database, you can select specific tables to export.
-
Select the destination folder for the export of an .sql file.
-
Select "Start Export" to start the export process.
Importing data
You can use the Data Import/Restore panel to import or restore the data exported with the data export operation.
-
In MySQL Workbench, in the "Navigator " pane, select "Data Import/Restore".
-
In the """Data Import/Restore**" pane, select the .sql file that you want to import.
-
Select the specific database into which the data will be imported.
-
Select "Start import" to start the import process.
Logging out
To exit the connection, click on the small "x" on the right side of the connection name located in the upper left corner of the MySQL Workbench window:
Remember that if you do not yet have a Cloud server with a Windows operating system, you can easily deploy it with SW Hosting.
cta:cloud_so