View Single Post
 
Old October 28th, 2007, 09:33 AM
crmpicco crmpicco is offline
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default cannot create one specific table using phpMyAdmin

I am using phpMyAdmin to upload my database to my server, but am running into some problems. It is mainly with one particular table, named "countries".

When i run the .SQL dump in phpMyAdmin I get the error:

Code:
CREATE TABLE `countries` (
`cityname` varchar( 100 ) default '',
`capital` varchar( 75 ) default '',
`shown` int( 1 ) default '0',
`countrycode` char( 2 ) default NULL ,
`provincecode` char( 2 ) default NULL ,
`provincename` varchar( 100 ) default '',
`provincecountrycode` char( 2 ) default NULL ,
`countryname` varchar( 100 ) default '',
`Geog_loc` varchar( 100 ) default NULL ,
`area` varchar( 5 ) default NULL ,
`nationality` varchar( 100 ) default NULL ,
KEY `countryname` ( `countryname` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8;

MySQL said: Documentation
#1046 - No database selected
Now this only seems to happen with this table as the dump executes fine when I take this out?

Also, when I have no records in the table on the server it gives me the following error when I do a PHP mysql_query() in my script:
Code:
SELECT command denied to user 'ayrshire_root'@'pass54.dizinc.com' for table 'countries'
This is the beginning of my MySQL dump (created with SQL Yog):
Code:
/*
SQLyog Community Edition- MySQL GUI v5.32
Host - 5.0.41-community-nt : Database - ayrshire_mini
*********************************************************************
Server version : 5.0.41-community-nt
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

create database if not exists `ayrshire_mini`;

USE `ayrshire_mini`;

/*!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' */;

/*Table structure for table `countries` */

DROP TABLE IF EXISTS `countries`;

CREATE TABLE `countries` (
  `cityname` varchar(100) default '',
  `capital` varchar(75) default '',
  `shown` int(1) default '0',
  `countrycode` char(2) default NULL,
  `provincecode` char(2) default NULL,
  `provincename` varchar(100) default '',
  `provincecountrycode` char(2) default NULL,
  `countryname` varchar(100) default '',
  `Geog_loc` varchar(100) default NULL,
  `area` varchar(5) default NULL,
  `nationality` varchar(100) default NULL,
  KEY `countryname` (`countryname`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

/*Data for the table `countries` */
Note: I changed the DEFAULT CHARSET from Latin to utf8 as I thought this might cause a problem.

Cheers,
Picco


www.crmpicco.co.uk
www.ie7.com
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk