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

后端 未结 30 2614
不知归路
不知归路 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:22

    Import into the database:

    mysql -u username -p database_name < /file path/file_name.sql

    Export from the database:

    mysqldump -u username -p database_name > /file path/file_name.sql

    After these commands, a prompt will ask for your MySQL password.

提交回复
热议问题