Forums

Problems using phpmyadmin to transfer WP databases (16 posts)

  1. Brian Score
    Member
    Posted 2 years ago #

    Hi , hope you can help solve a problem

    I am trying to transfer my WP databases between hosts and am having all sorts of problems. I have tried suggested tick box options and exporting is fine.

    When I try to import I get all sorts of error messages, is there a trick to this, there is so much conflicting information I thought I would ask the experts.

    Both phpmyadmin versions are the same 2.11.95 on each host.

  2. wordprest
    Member
    Posted 2 years ago #

    try to remove the db header; usually that works

  3. Brian Score
    Member
    Posted 2 years ago #

    Thank you for your reply. Sorry I am not that proficient with code, how do I access that?

  4. wordprest
    Member
    Posted 2 years ago #

    the first, make a safe copy of your db.
    then, simply open it with any simple text editor such as Notepad (NOT Word or similar), and delete all the information at the top of the script.
    You should notice a line that divides the header from the real database content; well, just delete all that is above that line.
    Save and try to upload.

  5. Brian Score
    Member
    Posted 2 years ago #

    I tried that and got the following error message:

    MySQL said:

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Table structure for table wp_comments

    DROP TABLE IF EXISTS wp_comments' at line 1

  6. wordprest
    Member
    Posted 2 years ago #

    You have something like that:

    # WordPress MySQL database backup
    #
    # Created: Tuesday 13. October 2009 12:38 CEST
    # Hostname: sql.mydomain.net
    # Database: blahblah
    # --------------------------------------------------------
    # --------------------------------------------------------
    # Table: wp_comments
    # --------------------------------------------------------

    #
    # delete table wp_comments
    #

    DROP TABLE IF EXISTS wp_comments;

    You probably deleted that last line...

  7. Brian Score
    Member
    Posted 2 years ago #

    What it starts with is this:

    Table structure for table wp_comments
    --

    DROP TABLE IF EXISTS wp_comments

    I deleted everything before the header line stops

  8. wordprest
    Member
    Posted 2 years ago #

    # WordPress MySQL database backup
    #
    # Created: Tuesday 13. October 2009 12:38 CEST
    # Hostname: sql.mydomain.net
    # Database: blahblah
    # --------------------------------------------------------
    # --------------------------------------------------------
    # Table: wp_comments
    # --------------------------------------------------------

    #
    # delete table wp_comments
    #

  9. Brian Score
    Member
    Posted 2 years ago #

    Hi, it looks like this:

    -- phpMyAdmin SQL Dump
    -- version 2.11.9.5
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generation Time: Oct 31, 2009 at 01:12 PM
    -- Server version: 5.0.81
    -- PHP Version: 5.2.9

    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;

    --
    -- Database: tenerif6_wrd01
    --

    -- --------------------------------------------------------

    --
    -- Table structure for table wp_comments
    --

    DROP TABLE IF EXISTS wp_comments;
    CREATE TABLE wp_comments (
    comment_ID bigint(20) unsigned NOT NULL auto_increment,
    comment_post_ID bigint(20) unsigned NOT NULL default '0',
    comment_author tinytext NOT NULL,
    comment_author_email varchar(100) NOT NULL default '',
    comment_author_url varchar(200) NOT NULL default '',
    comment_author_IP varchar(100) NOT NULL default '',
    comment_date datetime NOT NULL default '0000-00-00 00:00:00',
    comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
    comment_content text NOT NULL,
    comment_karma int(11) NOT NULL default '0',
    comment_approved varchar(20) NOT NULL default '1',
    comment_agent varchar(255) NOT NULL default '',
    comment_type varchar(20) NOT NULL default '',
    comment_parent bigint(20)

  10. wordprest
    Member
    Posted 2 years ago #

    Try to remove this:

    -- phpMyAdmin SQL Dump
    -- version 2.11.9.5
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generation Time: Oct 31, 2009 at 01:12 PM
    -- Server version: 5.0.81
    -- PHP Version: 5.2.9

    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;

    --
    -- Database: tenerif6_wrd01
    --

    -- --------------------------------------------------------

    --
    -- Table structure for table wp_comments
    --

    If doesn't work, try this:

    -- phpMyAdmin SQL Dump
    -- version 2.11.9.5
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generation Time: Oct 31, 2009 at 01:12 PM
    -- Server version: 5.0.81
    -- PHP Version: 5.2.9

    SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

    /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    /*!40101 SET NAMES utf8 */;

    --
    -- Database: tenerif6_wrd01
    --

    -- --------------------------------------------------------

    --
    -- Table structure for table wp_comments
    --

  11. Brian Score
    Member
    Posted 2 years ago #

    Hi tried both options, the message was

    MySQL said:

    #1046 - No database selected

    I was uploading an .....sql.zip file.

  12. wordprest
    Member
    Posted 2 years ago #

    how db weights?
    did you create a new, empty db in destination host?

  13. Brian Score
    Member
    Posted 2 years ago #

    The dbs are quite light, only about 100 posts.

    No I did not do it that way, I exported and then renamed before importing using phpmyadmin.

    Can I import text, csv, or other files, will it still work?

  14. wordprest
    Member
    Posted 2 years ago #

    Yes. But you have to import your database in a new one.

    1- create a new database on destination host.
    2- import the saved one in it.

  15. Brian Score
    Member
    Posted 2 years ago #

    Thank you so much, sometimes you cannot see the wood from the trees.

    In fact I did not alter the sql files, they dropped straight away without mods. Sorry to miss a fundamantal and waste your time.

  16. wordprest
    Member
    Posted 2 years ago #

    It doesn't matter. I'm alone at home just annoying...;-)

Topic Closed

This topic has been closed to new replies.

About this Topic