Quick facts
What is CodeIgniter ? CodeIgniter also php frameworkWhat is Laravel ? Ans Laravel is a high performance php frameworkWhat is php ? php is a hypertext pre processor

How to Import a MySQL Database using Command Line

How to Import a MySQL Database using Command Line

This tutorial will show you how to use the Command line to import a MySQL database. To import an existing file into MySQL, you will need to create a new database. This is where the SQL file's contents will be imported.

first time login your mysql .

Here Command :   
1.login: sudo mysql -u username -p password
   2.Create Database :  Use this command to create a database after logging into MySQL. Make a database. TYPE OF DATABASE;
   3. After create database than enter  your db using this command . Use Your DATABASE NAME;
   4. After Entry database than use this command and import database. source path ; [ example source /var/html/db.sql  ]
   5.Or this command mysql -u username -p db_name < file.sql

  * username : Username with which you connect to the database

 *db_name: The just formed database's name

  The SQL file to import, *file.sql, is in the current directory.

Alamin

Web developer. I write down the bugs I hit and how I fixed them.

Comments

Did this work for you, or did you hit something different? Leave a note.

Keep reading

Related notes