Tuesday, 02 Apr, 2024 -365

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.

Tags
Most Popular
img
How to install WordPress
02 Apr, 2024 view: 1957
img
Xampp Tutorial Create Your Own Local Test Server
02 Apr, 2024 view: 885
img
How to Install Laravel
02 Apr, 2024 view: 819
img
PHP is not recognized as an internal or external command
02 Apr, 2024 view: 610
img
How to Install Composer on Windows
01 Apr, 2024 view: 607
img
Summernote image upload
01 Nov, 2023 view: 553
img
How to clear select2 selected value in js
01 Nov, 2023 view: 426
img
Zipping and Unzipping Files in Linux
02 Apr, 2024 view: 376
img
How to add Datepicker in Bootstrap
26 Apr, 2024 view: 371
img
How to Import a MySQL Database using Command Line
02 Apr, 2024 view: 365
img
How to Installation Laragon
01 Apr, 2024 view: 212
img
How to Installing an SSL certificate on your server using cPanel
06 Apr, 2024 view: 183
img
Paypal Payment Gateway Integration With Laravel
06 Apr, 2024 view: 153
img
How to Use Laravel Middleware to Protect Your Application
09 Apr, 2024 view: 144
img
Laravel Cache Clear Command Php Artisan Optimize
09 Apr, 2024 view: 144
img
why important website development learn
10 Apr, 2024 view: 136
img
How to Integrate Stripe Payment in Laravel
06 Apr, 2024 view: 134
img
Laravel Authentication Tutorial
09 Apr, 2024 view: 133
img
laravel qr code generator package
18 Apr, 2024 view: 131
Trending