Announcement

Collapse
No announcement yet.

Need help with uploading MySQL database

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help with uploading MySQL database

    Hi, I'm just new in MySQL and PHP.

    My client gave me a backup copy of their website and database (NOT Full cPanel backup). My problem is when I upload the database using phpMyAdmin, It gave me this error

    Code:
     MySQL said: Documentation
    #1046 - No database selected
    When I opened the SQL file. I didn't saw any CREATE DATABASE in the file and it goes directly to CREATE TABLE

    Code:
    # phpMyAdmin SQL Dump
    # version 2.5.3-rc1
    # http://www.phpmyadmin.net
    #
    # Host: localhost
    # Generation Time: Jul 04, 2008 at 04:10 PM
    # Server version: 4.0.17
    # PHP Version: 4.3.3
    # 
    # Database : `database_name`
    # 
    
    # --------------------------------------------------------
    
    #
    # Table structure for table `discussion`
    #
    
    CREATE TABLE `discussion` (
      `discussid` int(11) NOT NULL auto_increment,
      `topicid` varchar(11) NOT NULL default '0',
      `name` varchar(255) NOT NULL default '''''',
      `email` varchar(255) NOT NULL default '''''',
      `password` varchar(255) NOT NULL default '''''',
      `topic` text NOT NULL,
      `content` text NOT NULL,
      `date` timestamp(14) NOT NULL,
      PRIMARY KEY  (`discussid`)
    ) TYPE=MyISAM AUTO_INCREMENT=1811 ;
    
    #
    # Dumping data for table `discussion`
    #
    
    ...
    NOTE: I have renamed the 'datebase_name'

    Do you guys have a trick that will help me here? I do not want to manual input these data on phpMyAdmin. And I have to do it on three of his website.

    Thanks in advance
    Last edited by ebobro; 05-07-2008, 06:58 PM.

  • #2
    Before you try to upload the sql file, if you look in the column on the left hand side you will see a combo box. Open this and select your database (it will have database_schema or something to that effect above it), and then upload the sql file.

    Comment


    • #3
      Thanks Chameleon, that worked. I first created the database and added the user in the MySQL file. Then upload it as you instructed

      Comment

      Working...
      X