SOLVED Unable to import database from shell

masterross

Well-Known Member
Apr 7, 2004
49
3
158
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!
 
Last edited by a moderator:

masterross

Well-Known Member
Apr 7, 2004
49
3
158
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!
 
  • Like
Reactions: Tarak Nath

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,911
2,234
363
Hello,

I'm glad to see you were able to solve the issue. Thank you for sharing the outcome.