Export and Import mysql Data in linux
Export all data in the entire database
1. Enter the following in the linux Command Line:
Mysqldump-u userName-p dabaseName> fileName. SQL
FileName. It is best to add the path name to SQL.
Export the data of a table in the database
Mysqldump-u userName-p dabaseName tableName> fileName. SQL
Export all table structures in the entire database
In the linux Command Line, enter:
Mysqldump-u userName-p-d dabaseName> fileName. SQL
Note:-d is added.
Export the table structure of a table in the entire database
In the linux Command Line, enter:
Mysqldump-u userName-p-d dabaseName tableName> fileName. SQL
Note:-d is added.
Import mysql method 1
Go to the linux Command Line:
Mysql-uroot-p press enter and enter the password source fileName. SQL. Note that fileName. SQL requires a path name, for example, source/home/user/data/fileName. SQL.
Method 2 for importing mysql
Go to the linux Command Line:
Mysql-uroot-p database <fileName. SQL note that fileName. SQL must have a path name