PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

For Loop to Import a Large Number of .sql Files to MySQL

#!/bin/bash

##
# Imports all .sql files in your current direcotry
##

for i in *.sql
do
    echo "Importing: $i"
    mysql your_db_name < $i
    wait
done

Here's a script that would import all of the .sql files in your current directory to MySQL.

I usually use that in case there are a lot of separate MySQL tables which need to be imported in one single database:

#!/bin/bash

##
# Imports all .sql files in your current direcotry
##

for i in *.sql
do
    echo "Importing: $i"
    mysql your_db_name < $i
    wait
done 

This could be quite useful if you have a lot of tables exported in .sql format which you need to import in a specific database.

Hope that it helps someone :)

BETA Snippet explanation automatically generated by OpenAI:

No explanation generated yet.

Snippet By Dev Dojo

ยท

Created June 12th, 2021

ยท

Report Snippet