How to import large sql file in phpmyadmin

前端 未结 20 1460
一向
一向 2020-11-29 17:04

I want to import a sql file of approx 12 mb. But its causing problem while loading. Is there any way to upload it without splitting the sql file ?

20条回答
  •  悲&欢浪女
    2020-11-29 17:47

    Just one line and you are done (make sure mysql command is available as global or just go to mysql installation folder and enter into bin folder)

    mysql -u database_user_name -p -D database_name < complete_file_path_with_file_name_and_extension 
    

    Here

    • u stands for User
    • p stands for Password
    • D stands for Database

    ---DON'T FORGET TO ADD < SIGN AFTER DATABASE NAME---

    Complete file path with name and extension can be like

    c:\folder_name\"folder name"\sql_file.sql

    ---IF YOUR FOLDER AND FILE NAME CONTAINS SPACE THAN BIND THEM USING DOUBLE QUOTE---

    Tip and Note: You can write your password after -p but this is not recommended because it will show to others who are watching your screen at that time, if you don't write there it will ask you when you will execute command by pressing enter.

提交回复
热议问题