1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Simple MySQL Importing table command question

Discussion in 'MySQL' started by Gavilles, Feb 22, 2009.

  1. #1
    Hey everyone

    I have made a backup of one of my Oscommerce table called "customers" (customersbackup.sql) sql format instead of csv.

    I tried restoring it via phpMyAdmin but it wont let me, it was trying to read it as a txt or csv, I dont see any option of .sql in the import function. Is there a command that I can use to restore this backup in the shell?

    Please advise

    Thanks :)
    Gav
     
    Gavilles, Feb 22, 2009 IP
  2. benjF

    benjF Peon

    Messages:
    107
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What do you mean it does not let you? What error message do you get?

    In phpmyadmin you goto the database and import. Then in the first box "File to import" browse for your file. Find your customersbackup.sql file.

    In the third box "Format of imported file" make sure you have SQL enabled.

    Click go button.

    That should be all.
     
    benjF, Feb 22, 2009 IP
  3. Gavilles

    Gavilles Peon

    Messages:
    377
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi

    I wish I can import the whole database because it will be as easy as that but I am only importing a single table of the database and it doesn't have that option in phpMyAdmin.

    Is there a SSH command to import a single table to a database?

    Thanks
    Gav
     
    Gavilles, Feb 22, 2009 IP
  4. robuk21

    robuk21 Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you want to try and run the script from the shell interface, simply upload the sql file and then log into mysql on the server.

    then type source <filename and path>;

    Hope this helps
     
    robuk21, Feb 22, 2009 IP