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?
- CSF Firewall Whitelist an IP Address IN CLI
- How to SFTP to a server with a private key?
- Install MySQL 8 on AlmaLinux 8
- How to Change ProFTPD Passive Ports and Make the Configuration Persistent?