mysql中字段为TEXT类型的内容怎么修改?
desc是TEXT类型的字段name是VARCHAR类型的字段这个就报错mysql>updatecm_terminalinfosetdesc='aa'whereid=30...
desc 是TEXT 类型的字段 name是VARCHAR 类型的字段
这个就报错
mysql> update cm_terminalinfo set desc='aa' where id=3022;
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 'desc='aa' where id=3022' at line 1
这个就正常
mysql> update cm_terminalinfo set name='aa' where id=3022;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0 展开
这个就报错
mysql> update cm_terminalinfo set desc='aa' where id=3022;
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 'desc='aa' where id=3022' at line 1
这个就正常
mysql> update cm_terminalinfo set name='aa' where id=3022;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0 展开
5个回答
展开全部
可以把字段类型改成MEDIUMTEXT(最多存放16777215个字符)或者LONGTEXT(最多存放4294967295个字符).
MySQL supports 4 TEXT field types (TINYTEXT, TEXT, MEDIUMTEXT and LONGTEXT) and this post looks at the maximum length of each of these field types.
MyISAM tables in MySQL have a maximum size of a row of 65,535 bytes, so all the data in a row must fit within that limit. However, the TEXT types are stored outside the table itself and only contribute 9 to 12 bytes towards that limit. (For more information about this refer to the MySQL Manual - Data Storage Requirements chapter).
TEXT data types are also able to store much more data than VARCHAR and CHAR text types so TEXT types are what you need to use when storing web page or similar content in a database.
The maximum amount of data that can be stored in each data type is as follows:
TINYTEXT 256 bytes
TEXT 65,535 bytes ~64kb
MEDIUMTEXT 16,777,215 bytes ~16MB
LONGTEXT 4,294,967,295 bytes ~4GB
In most circumstances the TEXT type is probably sufficient, but if you are coding a content management system it's probably best to use the MEDIUMTEXT type for longer pages to ensure there are no issues with data size limits.
MySQL supports 4 TEXT field types (TINYTEXT, TEXT, MEDIUMTEXT and LONGTEXT) and this post looks at the maximum length of each of these field types.
MyISAM tables in MySQL have a maximum size of a row of 65,535 bytes, so all the data in a row must fit within that limit. However, the TEXT types are stored outside the table itself and only contribute 9 to 12 bytes towards that limit. (For more information about this refer to the MySQL Manual - Data Storage Requirements chapter).
TEXT data types are also able to store much more data than VARCHAR and CHAR text types so TEXT types are what you need to use when storing web page or similar content in a database.
The maximum amount of data that can be stored in each data type is as follows:
TINYTEXT 256 bytes
TEXT 65,535 bytes ~64kb
MEDIUMTEXT 16,777,215 bytes ~16MB
LONGTEXT 4,294,967,295 bytes ~4GB
In most circumstances the TEXT type is probably sufficient, but if you are coding a content management system it's probably best to use the MEDIUMTEXT type for longer pages to ensure there are no issues with data size limits.
展开全部
desc是保留的
换其他字段名
换其他字段名
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
一下VB代码,用来修改数据库
res.open "select * from txl where name='文文'",conn,4,2
res.Fileds("Phone")="12345675489"
res.Updata
res.Close
res.open "select * from txl where name='文文'",conn,4,2
res.Fileds("Phone")="12345675489"
res.Updata
res.Close
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你在显示一个表的信息时是用desc tablename吗?所以说你的这个命令mysql不认识,或者你用
set [desc]='aa'来试一下
set [desc]='aa'来试一下
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
update 表名 set 字段='新内容'
你是指这样吗?还有问题的话,详细一点说明,我看看能不能帮你解决吧!
你是指这样吗?还有问题的话,详细一点说明,我看看能不能帮你解决吧!
追问
update 表名 set 字段='新内容'
你是指这样吗?还有问题的话,详细一点说明,我看看能不能帮你解决吧
这个不好用,我试了,其他字段这么修改可以,都好用。就TEXT修饰的字段不好用。报错。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |