SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Jun 2002
    Location
    Barcelona, Spain
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL error creating databases (errno: 121)

    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>");
    }; 
    Last edited by Gary Bauer; Jun 21, 2002 at 02:07.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •