In this article, we will see how to import SQL files into MySQL using the command. You can import databases in multiple ways on different types of servers. We will import the SQL file in xampp PHPMyAdmin using the command line. You can directly import the database in PHPMyAdmin. Using the command line you can import large-size databases.
So, let's see how to import the SQL files in PHPMyAdmin using the command line and command line to import the database in MySQL.
Syntax:
mysql -u username -p database_name < file.sql
username
refers to your MySQL username.database_name
refers to the database you want to import.file.sql
is your file name.
Example:
In this example, we will import backup_database_file.sql into the new_database_example database in PHPMyAdmin.
In this example, we will export the mysqldump
console utility exports databases to SQL text files. This makes it easier to transfer and move databases. You will need your database’s name and credentials for an account whose privileges allow at least full read-only access to the database.
Use mysqldump
to export your database:
Example:
In this example, we will export tutorial_database with the backup_file.sql file.
You might also like:
In this article, we will see how to get the id of an element using jquery. Using the jquery attr() method to get or...
Jul-04-2022
In this article, we will delve into the process of disabling sorting for specific columns in Datatables. If you find the...
Aug-24-2020
In this article, we will see how to toggle between dark and light modes using jquery. As per the current trend of web de...
Nov-24-2020
In this tutorial, we will see how to get current week records in MySQL. Many times we need to get current week reco...
Feb-07-2022