Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to import large .sql file to mysql via terminal

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 739
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: