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