The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL SSH dump & PhpMyAdmin

Discussion in 'Database Discussions' started by AnthonyR, Nov 27, 2003.

  1. AnthonyR

    AnthonyR Active Member

    Joined:
    Oct 28, 2003
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Hi Guys,

    Can anybody tell me why doing an SQL export via PHPMyadmin, the db can be restored via this command...

    mysql -u username -p databasename < dump.sql

    but doing a SQL dump via SSH

    mysqldump --opt -u dbusername -p dbname > dump.sql

    Cannot be restored via SSH
    ie: mysql -u username -p databasename < dump.sql

    I always get an error and - Please check that you have the right version of MySQL type errors.

    Has anyone else solved this issue? or have any recomendations please?

    Thanks in advance,
     
  2. AnthonyR

    AnthonyR Active Member

    Joined:
    Oct 28, 2003
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Does anyone have an idea on solving this?
     
  3. nukehelpers

    nukehelpers Member

    Joined:
    Jul 2, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Oklahoma City, OK
    I took this from another site but works fine for me

    prompt> mysqldump -uuser -ppassword database_name > file_name.sql

    You can name the file whatever you want. That'll export a copy of all the tables and information in your database.

    Load that file to the new server, create your database and use this to load up the database:

    prompt> mysql -uuser -ppassword database_name < file_name.sql

    There...you're done.

    Hope it works for you I know it did here.
     
Loading...

Share This Page