How to replace the default database SQLite with MySQL in Laravel sed -i.bak -e 's/^DB_CONNECTION=sqlite/DB_CONNECTION=mysql/g' -e 's/^# DB/DB/g' .env && rm -rf database/database.sqlite