Import and insert sql.gz file into database with putty

后端 未结 8 985
再見小時候
再見小時候 2021-01-30 00:12

I want to insert a sql.gz file into my database with SSH. What should I do?

For example I have a database from telephone numbers that name is numbers.

8条回答
  •  不要未来只要你来
    2021-01-30 00:28

    Login into your server using a shell program like putty.

    Type in the following command on the command line

    zcat DB_File_Name.sql.gz | mysql -u username -p Target_DB_Name
    

    where

    DB_File_Name.sql.gz = full path of the sql.gz file to be imported

    username = your mysql username

    Target_DB_Name = database name where you want to import the database

    When you hit enter in the command line, it will prompt for password. Enter your MySQL password.

    You are done!

提交回复
热议问题