execute sql script in mysql 8 code example Example: execute mysql file mysql -u yourusername -p yourpassword yourdatabase < text_file