Skip to main content

Posts

Showing posts with the label sql script

using mysqldump command to backup the data from MySQL Database table

Introduction In this blog post, we will take a look at the mysqldump command that is shipped as part of the MySQL clients. Data Backup We normally deal with backup of data by exporting the data as JSON / CSV or as SQL Files. This is required so that any change that we are working on might have a impact, we can immediately use the backup to fix any unexpected database operation. When working with JSON / CSV at times, we have to deal with the issues in the data formats. Further as SQL queries, we get the option to rewrite the query, insert them into a local database, perform the required transform or operations and then move to the server. The MySQL Workbench provides the export option through which we can generate the SQL scripts, but there are issues like the target table names are empty and there is a new insert statement for each row in the table. Example Command mysqldump.exe --host=servername --port= 3306 --default-character-set=utf8 --user=(db_user_name) -p --protocol=tcp --colu