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

后端 未结 30 2784
不知归路
不知归路 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条回答
  •  离开以前
    2020-11-22 07:17

    For exporting a database:

    mysqldump -u username -p database_name > file.sql
    

    For importing a database:

    mysql -u username -p database_name < file.sql
    

提交回复
热议问题