Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED Unable to import database from shell

Discussion in 'Database Discussion' started by masterross, Jul 20, 2018.

  1. masterross

    masterross Member

    Joined:
    Apr 7, 2004
    Messages:
    24
    Likes Received:
    1
    Trophy Points:
    151
    Hi guys,
    I'm trying to import big mysql DB from shell.
    I ran:
    mysql -uroot -p my_new_db < /bak3/old_db.sql
    It asks for pass I provide and after few min all is finished.
    But when I checked the user's DB (my_new_db) it's empty!
    Where gone all the data?

    Thank you!
     
    #1 masterross, Jul 20, 2018
    Last edited by a moderator: Jul 20, 2018
  2. masterross

    masterross Member

    Joined:
    Apr 7, 2004
    Messages:
    24
    Likes Received:
    1
    Trophy Points:
    151
    OK,
    I found the problem!
    In the dump file there was command:
    Create table if not exist, trying to make old table which is not permitted.
    So I used:
    sed -i '/old_gb/ s//new_db/g' mysqldump.sql
    Because the file is more then 5GB.
    After that I was able to inserted in DB.

    Regards!
     
    Tarak Nath likes this.
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,344
    Likes Received:
    1,852
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm glad to see you were able to solve the issue. Thank you for sharing the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice