How to easily import multiple sql files into a MySQL database?

后端 未结 11 1982
一整个雨季
一整个雨季 2021-01-29 20:02

I have several sql files and I want to import all of them at once into a MySQL database.

I go to PHPMyAdmin, access the databa

11条回答
  •  梦谈多话
    2021-01-29 20:13

    Save this file as .bat and run it , change variables inside parenthesis ...

    @echo off
    title Mysql Import Script
    cd (Folder Name)
     for %%a in (*) do (
         echo Importing File  : %%a 
         mysql -u(username) -p(password)  %%~na < %%a
    )
    pause
    

    if it's only one database modify (%%~na) with the database name .

提交回复
热议问题