PDA

View Full Version : Help in importing DB from ssh


badboyz
07-13-2007, 08:14 PM
hello.

im trying to import DB from SSH. after i entered

my details
mysqldump -u db_username -p db_name >backup.sql

it asks for password.

and after entered nothing happens.i checked on cpanel my DB is still empty.why is it

snakes1100
07-13-2007, 08:57 PM
mysql -u -p dbname < /path/to/db.sql

badboyz
07-13-2007, 09:34 PM
thats wat i did

snakes1100
07-13-2007, 10:45 PM
hello.

im trying to import DB from SSH. after i entered

my details
mysqldump -u db_username -p db_name >backup.sql

it asks for password.

and after entered nothing happens.i checked on cpanel my DB is still empty.why is it

Not according to your first post it isn't, mysqldump is for exporting the database.

Do you have the right database name and path to the backup file correct?

Are you sure the backup file your importing from actually has anything in it?

badboyz
07-13-2007, 11:24 PM
oh
i want to import.yes i have the right DB and infor

this is wat i typed

mysql -u game_new -p bla12 < game.sql

Eikinskjaldi
07-13-2007, 11:44 PM
oh
i want to import.yes i have the right DB and infor

this is wat i typed

Your problem is the spaces. there should be no spaces between the u and the username and the p and the password. Also, the mysql dump probably does not have a database in its specification.

instead of

mysql -u game_new -p bla12 < game.sql

use

mysql -ugame_new -pbla12 name_of_db < game.sql

badboyz
07-13-2007, 11:48 PM
i entered this

mysql -ugame_new -pbla12 game_new< game.sql

its keep asking me to enter the details
nothign happens

Dismounted
07-14-2007, 05:34 AM
Have you logged into MySQL?

Eikinskjaldi
07-15-2007, 12:12 AM
i entered this


mysql -ugame_new -pbla12 game_new< game.sql

its keep asking me to enter the details
nothign happens

What details does it ask you to enter? Its hard to help you when you are so vague.

Kirk Y
07-15-2007, 12:23 AM
Is "game.sql" in the right location? The way you're executing the query, it should be located in the root - is it?

UltimateOreo!
07-15-2007, 12:38 AM
Just make it easier on everyone and do it on a web interface.

Kirk Y
07-15-2007, 12:40 AM
SSH is the only reliable method of restoring and backing up a database. ;)