Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

import single table from mysql dump

# mysql dump from database name and table name
mysqldump --column-statistics=0 -h <hostanaem> -u <username> -p<password> --port 3306 <dbname> <table 1> <table 2> | gzip > mysql_dump.gz

# z Grep to only the table name that you want
# pipe the output to mysql
zgrep "^INSERT INTO `table_name" mysql_dump.gz | mysql -h <hostanaem> -u <username> -p<password> --port 3306 <dbname> <table name>
 
PREVIOUS NEXT
Tagged: #import #single #table #mysql #dump
ADD COMMENT
Topic
Name
3+8 =