MariaDB社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3579|回复: 5
打印 上一主题 下一主题

谁来帮我看看问题出在哪?谢谢!

[复制链接]
跳转到指定楼层
1#
发表于 2008-1-4 21:44:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
问题在附件,请问一下这个论坛怎么加图片?

mysql.png (8.2 KB, 下载次数: 216)

mysql.png

create_student_info.rar

641 Bytes, 下载次数: 2698

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播 分享分享 分享淘帖 顶 踩
2#
发表于 2008-1-4 23:38:28 | 只看该作者
你的语句看了,没有问题,在我的环境下运行了,是可以的,如下图:


提示:怀疑是你磁盘没有空间了...
3#
 楼主| 发表于 2008-1-5 20:34:04 | 只看该作者
硬盘空间还有,不知是不是以前删了还保留了部分信息(我是在data文件里面把它删了的)
4#
发表于 2008-1-6 01:13:50 | 只看该作者
有关系!
5#
发表于 2008-1-16 16:05:31 | 只看该作者
Errno: 121 means that you already have the table defined in your InnoDB tablespace, but the .frm file is not there.


You can't delete manually InnoDB .frm table file since the table isn't removed
from the table-space file. MyISAM not has that problem because all
the 3 files can be removed.

c:\mysql\bin>mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.19-nt-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use db1
Database changed
mysql> show variables like "%storage%";
+----------------+--------+
| Variable_name  | Value  |
+----------------+--------+
| storage_engine | MyISAM |
+----------------+--------+
1 row in set (0.01 sec)

mysql> create table tb5 (id int);
Query OK, 0 rows affected (0.06 sec)

mysql> exit
Bye

c:\mysql\bin>del ..\data\db1\tb5.*

c:\mysql\bin>mysql -uroot db1
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.19-nt-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table tb5 (id int);
Query OK, 0 rows affected (0.05 sec)

mysql> drop table tb5;
Query OK, 0 rows affected (0.00 sec)

c:\mysql\bin>mysql -uroot db1
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.19-nt-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show variables like "%storage%";
+----------------+--------+
| Variable_name  | Value  |
+----------------+--------+
| storage_engine | InnoDB |
+----------------+--------+
1 row in set (0.00 sec)

mysql> create table tb5 (id int);
Query OK, 0 rows affected (0.08 sec)

mysql> exit
Bye

c:\mysql\bin>del ..\data\db1\tb5.*

c:\mysql\bin>mysql -uroot db1
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.19-nt-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table tb5 (id int);
ERROR 1005 (HY000): Can't create table '.\db1\tb5.frm' (errno: 121)
mysql>

c:\mysql\bin>mysqld-nt --standalone --console --default-storage-engine=innodb
060218 16:08:07  InnoDB: Started; log sequence number 0 50056
060218 16:08:07 [Note] mysqld-nt: ready for connections.
Version: '5.0.19-nt-log'  socket: ''  port: 3306  Source distribution
060218 16:08:56  InnoDB: Error: table `db1/tb5` already exists in InnoDB internal
InnoDB: data dictionary. Have you deleted the .frm file
InnoDB: and not used DROP TABLE? Have you used DROP DATABASE
InnoDB: for InnoDB tables in MySQL version <= 3.23.43?
InnoDB: See the Restrictions section of the InnoDB manual.
InnoDB: You can drop the orphaned table inside InnoDB by
InnoDB: creating an InnoDB table with the same name in another
InnoDB: database and copying the .frm file to the current database.
InnoDB: Then MySQL thinks the table exists, and DROP TABLE will
InnoDB: succeed.
InnoDB: You can look for further help from
InnoDB: http://dev.mysql.com/doc/mysql/e ... oting_datadict.html

[ 本帖最后由 boxman 于 2008-1-16 16:08 编辑 ]
6#
发表于 2008-1-16 16:32:07 | 只看该作者
讲的对,原理就是这样的,分不同的表类型,分别对待。

060218 16:08:56  InnoDB: Error: table `db1/tb5` already exists in InnoDB internal
InnoDB: data dictionary. Have you deleted the .frm file
InnoDB: and not used DROP TABLE? Have you used DROP DATABASE
InnoDB: for InnoDB tables in MySQL version <= 3.23.43?
InnoDB: See the Restrictions section of the InnoDB manual.

如下也是一种解决办法:
先创建一个,再来删除!
InnoDB: You can drop the orphaned table inside InnoDB by
InnoDB: creating an InnoDB table with the same name in another
InnoDB: database and copying the .frm file to the current database.
InnoDB: Then MySQL thinks the table exists, and DROP TABLE will
InnoDB: succeed.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|MariaDB社区 ( 京ICP备07012489号    |
业务联系: QQ:48474881; 邮箱: 48474881@qq.com; 电话:13911732319
声明:本站部分文章是网友转载,若未经作者同意或署名有误,请联系网站管理员。

GMT+8, 2024-11-10 00:27 , Processed in 0.078372 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表