To import a MySQL dump file or an SQL data file into your database, follow these steps:
CREATE DATABASE database_name;
GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost' IDENTIFIED BY 'password';
mysql -u username -p database_name
source
command to import the dump file or data file into the database:source path/to/file.sql
Note that the source
command is used to execute a script file in the MySQL command-line client. The path/to/file.sql
should be replaced with the actual path to the file on your system.
If the file is large, the import process may take a while to complete. Once the import is finished, you can use the SHOW TABLES;
command to see the list of tables in the database.