I have shown how you can export a MySQL table to excel or CSV without any third party software.
All you can use CMD prompt to export export the table.
1. First login to your MySQL database through command prompt.
2. Now use the database in which you have the table to export.
3. Now I am going to export a table ‘attendance_time_shifts’ in the database ‘hr’
The command to be used to export is shown below,
select * from 'table_name' into outfile 'path' fields terminated by ',' lines terminated by '\n'
So in our example the command will be
select * from attendance_time_shifts into outfile "G:\\jinu\\attendance_time_shifts.csv" fields terminated by ',' lines terminated by '\n'
4. After executing the above command, The data of the table should have exported to the location specified.
No comments:
Post a Comment