Tuesday, 02 Apr, 2024 -327

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: 1889
img
Xampp Tutorial Create Your Own Local Test Server
02 Apr, 2024 view: 770
img
How to Install Laravel
02 Apr, 2024 view: 759
img
PHP is not recognized as an internal or external command
02 Apr, 2024 view: 558
img
How to Install Composer on Windows
01 Apr, 2024 view: 543
img
Summernote image upload
01 Nov, 2023 view: 496
img
How to clear select2 selected value in js
01 Nov, 2023 view: 377
img
Zipping and Unzipping Files in Linux
02 Apr, 2024 view: 343
img
How to add Datepicker in Bootstrap
26 Apr, 2024 view: 336
img
How to Import a MySQL Database using Command Line
02 Apr, 2024 view: 327
img
How to Installation Laragon
01 Apr, 2024 view: 179
img
How to Installing an SSL certificate on your server using cPanel
06 Apr, 2024 view: 147
img
Paypal Payment Gateway Integration With Laravel
06 Apr, 2024 view: 120
img
How to Use Laravel Middleware to Protect Your Application
09 Apr, 2024 view: 106
img
Laravel Cache Clear Command Php Artisan Optimize
09 Apr, 2024 view: 106
img
why important website development learn
10 Apr, 2024 view: 104
img
Laravel Authentication Tutorial
09 Apr, 2024 view: 103
img
How to Integrate Stripe Payment in Laravel
06 Apr, 2024 view: 101
img
laravel qr code generator package
18 Apr, 2024 view: 94
Trending