Import MySQL Database Dump File

From Gejoreuy
Revision as of 13:57, 22 October 2019 by Gejor (talk | contribs) (→‎Import the Dump File)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Purpose

This topic describes how to use the psql command to restore the MySQL data backup files to MySQL DB.


Import the Dump File

Just run below command and change it with the database value.

[root@gejoreuy ~]# mysql -u username -p -h hostname destinationdb < dumpfilenamelocation.sql

Note :

  • username: The username to log on to MySQL database.
  • hostname: The hostname of the MySQL database.
  • destinationdb: The MyQL database name.
  • dumpfilenamelocation : The location name of the backup file to be restored.