How do I import an SQL file using the command line in MySQL?

后端 未结 30 2625
不知归路
不知归路 2020-11-22 06:48

I have a .sql file with an export from phpMyAdmin. I want to import it into a different server using the command line.

I have a Windows Ser

30条回答
  •  萌比男神i
    2020-11-22 07:40

    Go to the directory where you have the MySQL executable. -u for username and -p to prompt for the password:

    C:\xampp\mysql\bin>mysql -u username -ppassword databasename < C:\file.sql
    

提交回复
热议问题