-2

I've got a problem with my mysql server. Basically I cannot upload my database... I tried already :

mysql -u username -p database_name > file.sql

mysqldump -p -u username database_name > dbname.sql

Nothing works... first method stuck after i insert password to mysql server and second method did nothing, after mysqldumb nothing happed...

Also I tried to use phpmyadmin, but durring uploading after 13s I get blank screen, with no error. I setup memory_limit and upload_max_filesize to 128M but still getting this problem.

Thanks

  • possible duplicate: http://stackoverflow.com/questions/17666249/how-to-import-a-sql-file-using-the-command-line-in-mysql – Chancho May 26 '14 at 18:00

3 Answers3

0

You can upload sql files using .rar or zip folder. via phpmyadmin in this case you will have compressed the file size and you shouldn't face that issue again.

user3592614
  • 99
  • 3
  • 13
0

You want to read from the sql file, not write to it.

Use < not > for the first line.

You may have to get a clean copy of file.sql as you've probably overwritten it.

(The second line is for copying the database into a file, not the other way around)

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0

The first command is only for connecting to the database. You are not seeing anything because all the output is being directed to file.sql. Try removing the > file.sql from the command and you should see errors or the sql prompt.

The second command "looks" ok, assuming you want to save data TO the file, not load data FROM the file.

To load data, use

mysql -h hostname -u user --password=password databasename < filename

Alexandre Santos
  • 8,170
  • 10
  • 42
  • 64