Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2013
    Location
    Sydney, Australia
    Posts
    140
    Plugin Contributions
    0

    Default Can't restore database after moving from localhost

    Hello,
    I looked for my solution to no avail.

    I made a customized site on my localhost, then did a backup of my db using phpmyadmin.
    I then uploaded my customized files to the server and did the install.
    However it looks like the generic version of my zencart see here: www.kinectwebdesign.com/zencart
    I tried to import the db backup I made from local machine but I get an
    Error
    SQL query:
    CREATE DATABASE example;
    MySQL said: Documentation
    #1044 - Access denied for user 'example'@'localhost' to database 'example'

    I have figured out from reading this post that my server db has a prefix and my localhost db doesn't. http://www.inmotionhosting.com/suppo...-error-message
    that I have to edit the zencart.sql file.
    Here's my problem, the db backup I made on localhost via phpmyadmin, exported it and it looks compressed.
    It looks like gobbledegook. Too confusing to edit, so how will I be able to restore the database?
    Can can I get a normal looking db back up from localhost phpmyadmin.

    This has stumped me for 2 days.
    Any help greatly appreciated.

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Can't restore database after moving from localhost

    Quote Originally Posted by Annie_zaz View Post
    Can can I get a normal looking db back up from localhost phpmyadmin.
    As you have observed, the file you exported was compressed. There is a setting in the phpmyadmin window that will let you export the data in uncompressed format.

    Alternatively, you can use your favourite zip/bzip/gzip program to decompress the file so that you can make the needed edits.
    (you don't need to re-zip in order to import).

    Another option (better for the long term) is to rename the tables of your local installation so they match what you need for the server. This way importing/exporting from one to the other is a breeze. Just make sure you change your local configuration files to match the database changes.

    Cheers
    Rod

  3. #3
    Join Date
    Mar 2013
    Location
    Sydney, Australia
    Posts
    140
    Plugin Contributions
    0

    Default Re: Can't restore database after moving from localhost

    Ok Rod will give it a go now, I'll let you know how I go !
    Thanks for the advice.

  4. #4
    Join Date
    Mar 2013
    Location
    Sydney, Australia
    Posts
    140
    Plugin Contributions
    0

    Default Re: Can't restore database after moving from localhost

    Quote Originally Posted by Annie_zaz View Post
    Ok Rod will give it a go now, I'll let you know how I go !
    Thanks for the advice.
    FIXED
    Ok, for anyone with this same problem I had made a database backup on my local machine using phpmyadmin.
    It was compressed but I uploaded it to the 'live server' and edited it there via my hosts code editor and it looked normal.
    (I did try this the previous night and it didn't work for some reason and had wasted time trying to edit via notepad and it looked compressed there too)
    I just made the database name the same as the new database that I created before transferring the files over and it worked.

 

 

Similar Threads

  1. v139h Foreign characters turns up as garbage after database restore
    By dysfunctional in forum General Questions
    Replies: 2
    Last Post: 21 Nov 2012, 09:22 PM
  2. Can't access database after moving to GoDaddy
    By daneh in forum General Questions
    Replies: 14
    Last Post: 29 Sep 2011, 04:57 AM
  3. Moving from windows server to linux server - how to restore database ?
    By PatF in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 26 Mar 2011, 02:26 PM
  4. moving from localhost to live
    By yamadan in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 9 Feb 2010, 07:37 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR