Linux Mysql dump restore.

Hello,
I was wondering if someone could help.

Im trying to restore a mysql dump to a new database… Which doesnt seem to be working.

Im using ubuntu server addition and here is the command im using

mysql -u user -p password newdatabase < dbdump.sql

user is my databases username
password is my databases password
newdatabase is a new database i created in phpmyadmin
dbdump.sql is my dump file which is 170mb.
Thats why im not importing it using phpmyadmin.

The output i get once i do that command is:

mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2
Copyright © 2002 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Usage: mysql [OPTIONS] [database]
-?, --help Display this help and exit.
-I, --help Synonym for -?
Options removed by me

Default options are read from the following files in the given order:
/etc/mysql/my.cnf ~/.my.cnf /usr/etc/my.cnf
The following groups are read: mysql client
The following options may be given as the first argument:
–print-defaults Print the program argument list and exit
–no-defaults Don’t read default options from any options file
–defaults-file=# Only read default options from the given file #
–defaults-extra-file=# Read this file after the global files are read

Variables (–variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)


auto-rehash TRUE
character-sets-dir (No default value)
default-character-set latin1
compress FALSE
database (No default value)
delimiter ;
vertical FALSE
force FALSE
named-commands FALSE
local-infile FALSE
no-beep FALSE
host (No default value)
html FALSE
xml FALSE
line-numbers TRUE
unbuffered FALSE
column-names TRUE
sigint-ignore FALSE
port 3306
prompt mysql>
quick FALSE
raw FALSE
reconnect FALSE
socket /var/run/mysqld/mysqld.sock
ssl FALSE
ssl-ca (No default value)
ssl-capath (No default value)
ssl-cert (No default value)
ssl-cipher (No default value)
ssl-key (No default value)
ssl-verify-server-cert FALSE
table FALSE
debug-info FALSE
user sugarcrm
safe-updates FALSE
i-am-a-dummy FALSE
connect_timeout 0
max_allowed_packet 16777216
net_buffer_length 16384
select_limit 1000
max_join_size 1000000
secure-auth FALSE
show-warnings FALSE

Any help appreciated

Cheers

Jon

Ignore it i sorted it.
I thought the username and password where for the dump, not the new database.

Cheers anyways!

I think you need the -h host-name

Restore using dump generated by mysqldump above:

* mysql -h host-name -u user-id -psupersecretpassword &lt; total-db-dump-file.sql
* mysql database-name -h host-name -u user-id -psupersecretpassword &lt; db-dump-file.sql

/edit too slow again lol… glad your sorted :smiley: