Create .sh script file to insert mysql data on ubuntu.

1. Create the New text file ,using .sh extension. Example : Insert.sh
2. Open the Insert.sh file Via text editor
3. Paste the below code.
mysql -u <mysql-username> -p<mysql-password>  < sql.sql
sql.sql file is like your sql dump.

4. Save the code and run  the below code to insert data to your database.
./Insert.sh    OR   sh Insert.sh

Post a Comment

Previous Post Next Post