Restore a backup or MySQL database backup

You can restore the MySQL backup in several ways. I will tell you a couple of them.

First, if you have it installed on the computer/server where you want to restore the database, it may be useful for you to recover the information. It simply uses the tool to execute SQL statements. Even this PhpMyAdmin tool has a place to upload a file with SQL statements to be executed on the server. The downside is that the backup file cannot be larger than 2 megabytes.

Another way to restore a backup would be through MySQL’s own command line system. With this system you can connect to a database on your computer or to any MySQL server that you have access permissions. The statement to restore a database on the local computer would be:

mysql –password=yourkey –user=youruser mybase < backup-file.sql

If we wanted to recover the backup on another server, we could also do it with the MySQL command line, but through a statement that includes the host to which we want to connect:

mysql –password=yourkey –user=yourusername -h 192.168.1.134 database < backup-file.sql

Take into account that the host to which we want to connect, in this case the server with the IP 192.168.1.134, must be allowed access with that username and password and for the computer from which we are connecting. Likewise, this login must also have privileges to execute the SQL statements of the backup on the database database.

The whole issue of permissions and privileges on MySQL databases is easily managed with .

Loading Facebook Comments ...
Loading Disqus Comments ...