Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7606021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:18:29+00:00 2026-05-31T00:18:29+00:00

I have this table in a mysql database: mysql> show columns from wifi_network_config_auth_algorithm; +————————+————-+——+—–+———+——-+

  • 0

I have this table in a mysql database:

mysql> show columns from wifi_network_config_auth_algorithm;
+------------------------+-------------+------+-----+---------+-------+
| Field                  | Type        | Null | Key | Default | Extra |
+------------------------+-------------+------+-----+---------+-------+
| wifi_network_config_id | int(11)     | NO   | PRI | NULL    |       | 
| auth_algorithm         | varchar(50) | NO   | PRI | NULL    |       | 
+------------------------+-------------+------+-----+---------+-------+

The table was created using liquibase. Table creation itself does not define primary keys. Following table creation, the following liquibase command is used to set the combination of 2 columns as the primary key:

<addPrimaryKey tableName="wifi_network_config_auth_algorithm"
        columnNames="wifi_network_config_id,auth_algorithm"
        constraintName="pk_wifi_network_config_auth_algorithm"/>

Now, when you execute this to load data into this table:

LOCK TABLES `wifi_network_config_auth_algorithm` WRITE;
INSERT INTO `wifi_network_config_auth_algorithm` VALUES
(1, 'OPEN'),
(1, 'SHARED'),
(2, 'SHARED'),
(2, 'LEAP');
UNLOCK TABLES;

You get:

ERROR 1062 (23000): Duplicate entry '1' for key 2

Since the combination of both columns is the primary key, so the combination of the data in the two columns should be unique – which is true for the data shown above. Why is mysql complaining?

Also, it’s complaining that the value ‘1’ is being assigned to key 2, which does not make sense. I changed the INSERT to:

INSERT INTO `wifi_network_config_auth_algorithm` (`wifi_network_config_id`, `auth_algorithm`)

but it did not make any difference – same complaint from mysql.

Thanks,
Hari

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:18:30+00:00Added an answer on May 31, 2026 at 12:18 am

    Figured out the issue with @kbenson’s help. The answer is in the comments for the original question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this mysql table called comments which looks like this: commentID parentID type
I have a mysql database table called character with columns like name, strength, intelligence,
Hi I have been using this code to fetch data from mysql database and
I have a script that grabs data from a MySQL database table and creates
I have mysql database with table users. In users there are columns: id ,
I have a table in a MSSQL database that looks like this: Timestamp (datetime)
I have this in a MySQL db: table Message sender_id int recipient_id int created
Let's say I have a MySQL table that is something like this: software table:
I have a MySQL table like this: Payments +----+---------------------+---------+ | id | date (sorted
This is the MySQL table structure that I have: itemID (BIGINT) userID (BIGINT) wasAdded

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.