Home Comments Thread
New Thread

11 Comments

giscus-bot giscus-bot 2022-12-16 14:14:04
访客 *游客* @ 2008-04-15 15:00:51 写道:

到目前的版本,根本就没有这种语法。
只有Rename tabel,而没有Rename {database|schema}的。
我想你可能是搞错了。

**mysql> create database test1;** Query OK, 1 row affected (0.09 sec)

mysql> rename database test1 to test2;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'datab
ase test1 to test2' at line 1
mysql> rename schema test1 to test2;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'schem
a test1 to test2' at line 1

yihui yihui 2022-12-16 14:14:15

我用的是MySQL Server 6.0,没问题。

**mysql> create database test1;** Query OK, 1 row affected (0.00 sec) **mysql> rename database test1 to test2;** Query OK, 0 rows affected (0.30 sec)

——原帖发布于 2008-04-15 22:05:09

giscus-bot giscus-bot 2022-12-16 14:14:05
访客 *aniu* @ 2008-04-18 11:45:58 写道:

哦,6.0目前还只是Alpha版,我觉得应该不太稳定,所以没有去用。
至于重命名库,我用了最“暴力”的方式来解决的,直接重命名了对应的文件夹的名字,嘿嘿……
不过,如果有个应用正在使用这个库的话,这样会出问题的;但是,无论采用任何方式来重命名库,只要有应用在使用这个库,都会出问题,不是吗?

ps:上次没有注册一个名字,为了方便以后与您的交流,这次注册了。

yihui yihui 2022-12-16 14:14:17

一般情况下我觉得重命名数据库的机会还是非常少的

——原帖发布于 2008-04-20 09:48:25

giscus-bot giscus-bot 2022-12-16 14:14:06
访客 *aniu* @ 2008-04-18 12:10:21 写道:

刚才查了一下,看来在5.1版本中已经有了这个用法,只是在中文的参考手册中并没提到这个用法,但从英文版本的文档描述中看,这个功能尽量不要用。
http://dev.mysql.com/doc/refman/5.1/en/rename-database.html

yihui yihui 2022-12-16 14:14:16

谢谢提醒:)

——原帖发布于 2008-04-20 09:47:32

giscus-bot giscus-bot 2022-12-16 14:14:07
访客 *123* @ 2008-06-10 08:08:55 写道:

我6.0的咋不行呢?

giscus-bot giscus-bot 2022-12-16 14:14:08
访客 *艾昂饰* @ 2008-06-13 07:40:54 写道:

确实不能用,5.5

yihui yihui 2022-12-16 14:14:18

可能开发者又去掉这个功能了吧,看下面的链接。

——原帖发布于 2008-06-10 09:01:15

giscus-bot giscus-bot 2022-12-16 14:14:09
Guest *~* @ 2008-09-01 07:38:14 originally posted:

😓 😡

giscus-bot giscus-bot 2022-12-16 14:14:10
访客 *pw* @ 2010-08-13 06:31:32 写道:

收益。thanks
顺便提一下,评论表单各个字段的可输入暗示不强,不知道哪里可输入内容。也称用户体验不佳

yihui yihui 2022-12-16 14:14:19

哦,谢谢,好歹你还是成功发出了评论……凑合用吧……

——原帖发布于 2010-08-13 08:48:35

giscus-bot giscus-bot 2022-12-16 14:14:11
访客 *darkmi* @ 2011-07-22 13:00:10 写道:

刚试了,mysql5.0确实没有这个功能。。。

giscus-bot giscus-bot 2022-12-16 14:14:12
访客 *cm* @ 2011-11-16 13:38:25 写道:

进入仓库文件夹, 找到对应文件夹,然后mv .... 不知是否会引起其他不好的后果,不过确实可以改名~~

giscus-bot giscus-bot 2022-12-16 14:14:20
访客 *restore-deleted-files* @ 2012-04-28 03:46:54 写道:

好像不行哦,老是报ERROR 1064(42000)错误,晕死

giscus-bot giscus-bot 2022-12-16 14:14:13
访客 *www.tonitech.com的站长* @ 2013-01-28 09:21:43 写道:

为什么我这里不行啊?

giscus-bot giscus-bot 2022-12-16 14:14:14
访客 *www.qianqic.com* @ 2016-02-19 10:14:57 写道:

亲测,不能用,不要随便转发啊,自己要测测。

yihui yihui 2022-12-16 14:14:20

看看帖子时间啊亲,快十年前了,那时候还是可用的

参见 http://stackoverflow.com/q/67093/559676

——原帖发布于 2016-02-19 18:45:45

Sign in to join the discussion

Sign in with GitHub