Anyone know what could be causing my MySQL error?
"Can't create table '.\DBName\TableName.frm'(errno: 121)"
It occurs sometimes when I run a php script to create a bunch of tables. When it occurs, I down and restart the MySQL server and the script runs OK.
A sample from the script is below. The error relates to the CREATE TABLE query.
PHP Code:$sql="DROP TABLE Application";
if(@mysql_query($sql)){
echo("<p>Old Application table dropped.</p>");
}else{
echo("<p>Error dropping old Application Table: " . mysql_error() . " </p>");
};
$sql="CREATE TABLE Application(
App_ID int auto_increment not null primary key,
App_Name varchar(255) not null,
App_Version varchar(255) not null,
App_Language varchar(255) not null,
App_Standard_Monthly_Fee decimal(10,2)not null,
App_Current_Monthly_Fee decimal(10,2)not null
) type=innodb";
if(@mysql_query($sql)){
echo("<p>New Application table created.</p>");
}else{
echo("<p>Error creating Application Table: " . mysql_error() . " </p>");
};



Bookmarks