In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
How to set the mysql data not to repeat? This problem may be often seen in our daily study or work. I hope you can gain a lot from this question. The following is the reference content that the editor brings to you, let's take a look at it!
The method of mysql data setting is not repeated: first, use navicat to connect to the mysql database, and select the user name right-click to select the design table; then switch to the index tab in the design table, and select the fields that need unique constraints; finally, select the Unique type.
How to set the mysql data not to repeat:
1. Use navicat to connect to the mysql database and create a new user table.
2. Then fill in several test items to demonstrate the test effect.
3. Select the user name and right-click to select the design table.
4. then switch to the index tab in the design table.
5. This step begins to add an index. If there is no requirement for the index name, it can be empty by default, and the tool will automatically generate the same name as the field name. Click the button at the back of the field to bring up the selection box and select the field that requires unique constraints. Here we log in the name field.
6. Index type selection, here is the key, uniqueness constraint must select Unique type.
7. After adding the unique index, modify the login name of the third piece of data to bb, which is the same as the second, and then click the check button below to save it
8. An error will be reported when saving at this time, prompting "Duplicate entry 'bb' for key' login_name'". The duplicate login name cannot be saved successfully, indicating that the added uniqueness constraint is in effect.
Thank you for reading! After reading the above, do you have a general understanding of the method of setting non-repetition of mysql data? I hope the content of the article will be helpful to all of you. If you want to know more about the relevant articles, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.