Import SQL file using the command line in MySQL?
Import a .sql file using the command line. Replace the username and database name and the sql file with the actual values.
mysql -u username -p database_name < file.sql
For this to work, an empty database must exist. If the database does not exist, then you must create an empty database and then run the command above to import.
Related Categories:
Articles Sharing the Same Category
- How to Generate OpenVPN Client Configuration Files?
- How to Change ProFTPD Passive Ports and Make the Configuration Persistent?
- How to SFTP to a server with a private key?
- How To Set Up and Configure an OpenVPN Server on Linux?
- How to Install PHP 8.1 on AlmaLinux 8?