Set a unique key for MySQL

Source: Internet
Author: User
Environment: NavicatforMysql8.2MySQLSever5.1 problem: MySQL graphic setting unique key solution: graphical tools do not have this function. You can use SQL commands. 1. modify a table, such as ALTERTABLEtablenameADDUNIQUE [index name] (column list). 2. Specify an index when creating a table, for example, CREATETABLEta.

Environment: NavicatforMysql8.2 MySQL Sever 5.1 problem: MySQL graphic setting unique key solution: graphical tools do not have this function. You can use SQL commands. 1. modify a TABLE, for example, alter table tablename add unique [index name] (column list); 2. Specify an index when creating a TABLE, for example, create table ta

Environment: NavicatforMysql8.2 + MySQL Sever 5.1

Problem: Set the unique key in the MySQL graphical interface

Solution: this function is not available in graphic tools. You can use SQL commands.

1. modify a table, for example

Alter table tablename add unique [index name] (column list );


2. Specify an index when creating a table, for example

Create table tablename ([...], UNIQUE [index name] (column list ));


References:

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.