If you want to import large sql file to mysql via terminal, here are the steps:
First go to terminal, for Linux (UBNTU) user can go directly by pressing Ctrl-Alt-t key.
Now write down the following commands in Terminal.
mysql -u <username> -p <anydatabase_name>
After writing the above command, terminal will ask for password, you have to enter the password of database .
Enter Password:
<Database_password>
c. Now next command- Create a new database if database to which the sql file is to be imported does not exists.
mysql>create database <database_name>;
d. Specify the database name to which the .sql file is to be imported.
mysql>use <databasename>;
e. Specify the source of your sql file.
mysql>set autocommit=0; source <file path in local directory>; commit;
0 Comment(s)