Home > Database > Mysql Tutorial > MySQL设置唯一键

MySQL设置唯一键

WBOY
Release: 2016-06-07 15:18:28
Original
2471 people have browsed it

环境:NavicatforMysql8.2 MySQL Sever 5.1 问题:MySQL图形化设置唯一键 解决: 图形化工具没有这个功能。可以使用SQL命令。 一:修改表,例如 ALTER TABLE tablename ADD UNIQUE [索引的名字] (列的列表); 二:创建表的时候指定索引,例如 CREATE TABLE ta

环境:NavicatforMysql8.2+ MySQL Sever 5.1

问题:MySQL图形化设置唯一键

 

解决:图形化工具没有这个功能。可以使用SQL命令。

一:修改表,例如

ALTER TABLE tablename ADD UNIQUE [索引的名字] (列的列表);
Copy after login


二:创建表的时候指定索引,例如

CREATE TABLE tablename ( [...], UNIQUE [索引的名字] (列的列表) );
Copy after login


参考资料:

http://hi.baidu.com/k45hifz/item/c977720eeeaaff183b53ee5e

http://topic.csdn.net/u/20070604/15/f748623b-b871-43cc-b9f3-81fba8425774.html?seed=110138474&r=55821404#r_55821404





Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template