How to Import .sql file in MYSQL sever via Terminal

 In this blog, we are learning Simple tricks. how to dump SQL file in SQL server via terminal this was a very useful trick you must learn about this because in some scenario we want to import .sql to our Database




So let's get a starter

First, go to the terminal window and log in as a root user with your own credentials  After that Create a Database

mysql -u root -p 

eg:- mysql -u saran -p

mysql> create database your-name;

eg: create database inv_test;

mysql> show databases;









mysql> use YOUR DATABASE NAME;
eg: mysql> use inv_test;

mysql> source /YOURPATH/FILE.SQL;

 

eg: mysql> source /home/shabeer/Desktop/new_file.sql;

that's it guys.Now you got it!!!!

Post a Comment

Previous Post Next Post