In linux, the mysql database is imported and exported.
Objective: To import data from mysql on the server to a Local Machine
Device: Local: Mac. Remote Server: linux
Log on to the server using ssh
Mysqldump-u [username]-p [database_name]> [/path/dumpfilename. SQL]
For example, 'mysqldump-u root-p mywordpress>/var/mywordpress. SQL
Use the software filezilla on Mac to download mywordpress. SQL exported in step 1 to your local device.
Mysql-u [username]-p [database_name] <[dumpfilename. SQL]
Specifically, database_name must be an existing database in the local database, such as creating a new database.
Articles you may be interested in:
- How to easily Import and Export MySQL Databases on Linux VPS/Server
- Mysql import and export tool Mysqldump and Source command usage details
- Summary of Solutions to Chinese garbled characters in mysql import and export data
- MySQL Database Export and Import and common error Solutions
- How to solve Chinese garbled characters in the csv file imported and exported by Mysql
- How to import and export databases and data tables from mysql
- Detailed description of mysqldump backup restoration and mysqldump Import and Export Statements
- How to use MySQL to import and export commands for Backup Recovery