Help importing a database

Discussion in 'MySQL' started by Aardvarked, Feb 15, 2007.

  1. #1
    Hello, I just exported a database as a .sql file (Not through phpmyadmin as I don't have access to it on that webhost)

    I then tried to import it using phpmyadmin on my other webhost and got this message

    My knowledge of mysql/phpmyadmin is very limited so I would appreciate if someone could explain to me what this error actually means and how I can fix it. Thank you.
     
    Aardvarked, Feb 15, 2007 IP
  2. toby

    toby Notable Member

    Messages:
    6,923
    Likes Received:
    269
    Best Answers:
    0
    Trophy Points:
    285
    #2
    can you show us the .sql fie? most likely, you can use copy and paste the content of the .sql into the sql editor of the phpmyadmin.
     
    toby, Feb 15, 2007 IP
  3. Aardvarked

    Aardvarked Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I'll try that, if not i'll upload the .sql file. Thanks
     
    Aardvarked, Feb 15, 2007 IP
  4. Aardvarked

    Aardvarked Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    My firefox crashed every single time I tried to paste it. What more can you suggest? I've created a backup of the database both through vBulletin and through my cpanel, neither of which phpmyadmin lets me import.

    Sorry for the doublepost :<
     
    Aardvarked, Feb 15, 2007 IP
  5. Aardvarked

    Aardvarked Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Sorry for these posts but no-one is responding and this is quite urgent.

    I've managed to make a backup of my database, create a new database then import the old database entries into that one. I've coped my files over, changed the database settings in the config file and i am now getting a Database error page. I have no idea why.

    Help me please
     
    Aardvarked, Feb 15, 2007 IP
  6. ThreeGuineaWatch

    ThreeGuineaWatch Well-Known Member

    Messages:
    1,489
    Likes Received:
    69
    Best Answers:
    0
    Trophy Points:
    140
    #6
    Hi,

    Did you create the database prior to attempting the import?

    Can you show us the first 10 or 20 lines of the sql file?

    Do you have shell access?

    Cheers,
     
    ThreeGuineaWatch, Feb 15, 2007 IP
  7. Aardvarked

    Aardvarked Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    The database was exported and imported with no errors, I believe the problem to be in me editing the config file.

    Here's the first 20 lines anyway

    -- MySQL dump 10.10
    --
    -- Host: web23.extendcp.co.uk    Database: web23-wgforum
    -- ------------------------------------------------------
    -- Server version	5.0.26-standard
    
    /*!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 */;
    /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
    /*!40103 SET TIME_ZONE='+00:00' */;
    /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
    /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
    /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
    
    --
    -- Table structure for table `access`
    --
    
    DROP TABLE IF EXISTS `access`;
    CREATE TABLE `access` (
      `userid` int(10) unsigned NOT NULL default '0',
      `forumid` smallint(5) unsigned NOT NULL default '0',
      `accessmask` smallint(5) unsigned NOT NULL default '0',
      PRIMARY KEY  (`userid`,`forumid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    
    --
    -- Dumping data for table `access`
    Code (markup):
     
    Aardvarked, Feb 15, 2007 IP
  8. Neptune

    Neptune Well-Known Member

    Messages:
    1,465
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    108
    #8
    You must create the database first or it will cause the exact error you are receiving.
     
    Neptune, Feb 15, 2007 IP
  9. Aardvarked

    Aardvarked Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I did create the database first. I found out the problem - I did not add myself as a user to the database when I created them, stupid mistake.

    I know this is a bit off topic but now I have got the forums up, I cannot log in anymore. I type in my login details, it says logging in and then it just refreshes and I'm not logged in.. I guess it's a cookies issue but I dont really have a clue how to fix it. Can anyone help? Thank you
     
    Aardvarked, Feb 16, 2007 IP