Suppose you have to select custom fields in TableA and insert those fields into TableB in mysql, then the following shell script command would be appropriate.
mysql -u user -p -D database -e 'insert into TableB select id, addr from TableA;'
Insert above code in a file and save it as ".sh" file extension. Then run it as "./Test.sh".
NOTE :- Test.sh must be stored in the server that mysql db server is running.
No comments:
Post a Comment