rperry_wha
asked on
mysql table exists and doesn't
I am trying to restore from a dump:
DROP TABLE IF EXISTS `patients`;
CREATE TABLE `patients` (
`patientID` int(11) NOT NULL auto_increment,
`QS1CODE` varchar(24) character set utf8 collate utf8_bin default NULL,
`DoctorCode` int(11) default NULL,
....
PRIMARY KEY (`patientID`)
) ENGINE=InnoDB AUTO_INCREMENT=184163 DEFAULT CHARSET=utf8;
And I get:
ERROR 1051 (42S02): Unknown table 'patients'
ERROR 1050 (42S01): Table 'patients' already exists
ERROR 1146 (42S02): Table 'rperry_wha.patients' doesn't exist
ERROR 1146 (42S02): Table 'rperry_wha.patients' doesn't exist
ERROR 1146 (42S02): Table 'rperry_wha.patients' doesn't exist
ERROR 1146 (42S02): Table 'rperry_wha.patients' doesn't exist
ERROR 1146 (42S02): Table 'rperry_wha.patients' doesn't exist
ERROR 1146 (42S02): Table 'rperry_wha.patients' doesn't exist
DROP TABLE IF EXISTS `patients`;
CREATE TABLE `patients` (
`patientID` int(11) NOT NULL auto_increment,
`QS1CODE` varchar(24) character set utf8 collate utf8_bin default NULL,
`DoctorCode` int(11) default NULL,
....
PRIMARY KEY (`patientID`)
) ENGINE=InnoDB AUTO_INCREMENT=184163 DEFAULT CHARSET=utf8;
And I get:
ERROR 1051 (42S02): Unknown table 'patients'
ERROR 1050 (42S01): Table 'patients' already exists
ERROR 1146 (42S02): Table 'rperry_wha.patients' doesn't exist
ERROR 1146 (42S02): Table 'rperry_wha.patients' doesn't exist
ERROR 1146 (42S02): Table 'rperry_wha.patients' doesn't exist
ERROR 1146 (42S02): Table 'rperry_wha.patients' doesn't exist
ERROR 1146 (42S02): Table 'rperry_wha.patients' doesn't exist
ERROR 1146 (42S02): Table 'rperry_wha.patients' doesn't exist
ASKER
I've tried that:
mysql> use rperry_wha;
Database changed
mysql> drop table rperry_wha.patients;
ERROR 1051 (42S02): Unknown table 'patients'
mysql> FLUSH TABLES;
Query OK, 0 rows affected (0.00 sec)
mysql> drop table rperry_wha.patients;
ERROR 1051 (42S02): Unknown table 'patients'
mysql> FLUSH TABLES WITH READ LOCK;
Query OK, 0 rows affected (0.00 sec)
mysql> UNLOCK TABLES ;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH TABLES WITH READ LOCK;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH TABLES;
Query OK, 0 rows affected (0.00 sec)
mysql> drop table rperry_wha.patients;
ERROR 1223 (HY000): Can't execute the query because you have a conflicting read lock
mysql> use rperry_wha;
Database changed
mysql> drop table rperry_wha.patients;
ERROR 1051 (42S02): Unknown table 'patients'
mysql> FLUSH TABLES;
Query OK, 0 rows affected (0.00 sec)
mysql> drop table rperry_wha.patients;
ERROR 1051 (42S02): Unknown table 'patients'
mysql> FLUSH TABLES WITH READ LOCK;
Query OK, 0 rows affected (0.00 sec)
mysql> UNLOCK TABLES ;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH TABLES WITH READ LOCK;
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH TABLES;
Query OK, 0 rows affected (0.00 sec)
mysql> drop table rperry_wha.patients;
ERROR 1223 (HY000): Can't execute the query because you have a conflicting read lock
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
DROP TABLE IF EXISTS perry_wha.patients;