What is the method for exporting a specific table in MySQL?
The method for exporting a specific table using the MySQL command line tool is as follows:
- Open the command line tool and input the following command to connect to the MySQL database:
mysql -u username -p database_name
username is the database username, and database_name is the name of the database. Then, enter the password to connect.
- Enter the following command to export a specific table:
mysqldump -u username -p database_name table_name > export_file.sql
table_name is the name of the table to be exported, and export_file.sql is the name of the exported file.
- Please enter the password to confirm the export. Once the export is completed, you can find the exported SQL file in the current directory.