blog posts

Import information in cPanel host database through phpmyadmin tool

After preparing a host such as Iran or WordPress host, you should keep an eye on its various parts, including PHPMyAdmin, which is related to database management. Sometimes you need to restore the database backup and use its previous information for various reasons, such as moving the site or cleaning the database. In such a situation, creating a new database in the host and importing the database information is the best solution. Be careful; you must export or output from the SQL file beforehand. You have done it through PHPMyAdmin on your host. In this educational video on Fa Host knowledge base, we have decided to teach you how to import data into the cPanel host database so that after that, you will be able to import the database in the easiest way possible through CPanel’s PHPMyAdmin tool.

 

 

  • When is it useful to import or enter information into the database?
  • How to import MySQL information into PHPMyAdmin

When is it useful to import or enter information into the database?

Imagine that you are the manager of a website and you have launched your site with a content management system such as Joomla or WordPress, which operate through a database, and now you have decided to move your site from localhost to host or Transfer from the current host to another host, the first step is to transfer your website files to the new host, and the second step is to get a .sql output from your current host’s database. We have taught you and the next step is to import the .sql output file of your previous host into the new host through the phpmyadmin tool.

How to import mysql information into phpmyadmin

Imagine that you are the manager of a big site and in order to make sure that you don’t lose the information and data on your site, you always back up the database of your host and every day you output a .sql file from your website host. Now suddenly your site has encountered a problem and with this training you can enter the database management of your website and delete all the current damaged tables, then the database backup file or the same .sql output from the database that when your site has a problem If you haven’t backed up the database, import your website into the PHPMyAdmin host so that your website returns to its original state, so stay with us for the rest of this practical tutorial.

First, we will enter the cPanel host of our website through the tutorial on how to enter cPanel, then click on the phpmyadmin icon from the databases section.

To be directed to the database management section, of course, this page may take some time to load, from the database server section on the right side of this page, we first take a look at the mysql version of our host, here from the Server version section, our server database version is 5.6 34. It has been registered and at the end of the training, we will provide an explanation about the database version, very well, now we click on the name of the database we want from the left side, because the name of the database we want is mizbanf2_wordpress, we click on it until the tables of our database be loaded

Import database

These are our database tables very well, but if you want to import the .sql output file into a new host or database, there are no tables or information inside here. Before continuing, we will open our site in the browser before Let’s take a look at the beginning of the steps, so we type mizbanfa.net and hit enter; as you can see, it’s a simple WordPress site, and now we go back to PHPMyAdmin. Here we have two ways:

  1. We can delete the previous database. Create a new database and import the information into it. For this purpose, tutorial on creating a database in cPanel using the MySQL Databases tool and creating a new database.
  2. The second solution is to delete all the tables in the database because we have another output file from the same database. We want to import it, so here we tick the check all option from below so that all the tables are selected and now from this part the option We choose drop because we want to delete all the tables. Next, we import the previous database here.

Import database in the host

Before continuing this work, remember that you must have a backup file or a .sql output from this database because after doing this, all the information in this database will be deleted; on this page, you will see the message deleting the database information . Do you mean that you are sure to do this and delete all the database tables? And we click on the yes button from here. As you can see, all the information and tables inside this database are deleted from our host, and there is nothing here anymore; we enter the mizbanfa.net website again in the browser, and as you can see, the whole site is gone, and we are faced with the message of restarting WordPress.

Delete databases

Well, let’s go back to phpmyadmin because now we want to restore the .sql file of our database, which can be said to be the output or backup of our database information, into this database, so while we are in the desired database, click on the import button from above. to enter this page.

Import database in the host

And here, from the File to Import section, we select the choose file option, and now we select the output version of our database, whose format is .sql, from our computer. And we have nothing to do with the rest of the values ​​and we click on the go button from below to start the database import process.

Import mysql database

This step may take some time, so we wait for 5 seconds, it is very important to see the green message “Import has been successfully finished” because just seeing this message means that all the database tables have been imported without any problems.

Import mysql database

And as you can see, when we click on the name of our database from the left side, it is quite clear that all the tables of the WordPress database are included again; we return to the site to see the result again, so we type mizbanfa.net and enter, yes and As you can see, our WordPress site is back to its original state and is working without any problems.

The problem when importing database in cPanel host

Sometimes after loading the database file and pressing the go button, you may not see that green message, and it shows you a series of unknown errors; there are several reasons, including:

  • The output format of your database file may not be compatible with the data input format.
  • The output file of your database may be incomplete.
  • This very common reason is that the MySQL version of the host from which you got the database output file may not be the same as the MySQL version of the host into which you are importing the output file, and this may cause trouble most of the time, you should inform your server administrator or hosting company to upgrade the version of your MySQL host so that you can import the output files of the database into your new host database.

In the next educational video, how to create a site using the site publisher tool in cPanel , so that after that you will be able to create a simple and stylish site using the cPanel website launch tool, which has recently been added to this popular control panel. Create for yourself without any need to write code. So stay with us and to see more tutorials about cPanel, which is one of the most popular management control panels, please refer to classified tutorials and take advantage of all our tutorials for free.