{"id":8717,"date":"2005-03-19T06:36:07","date_gmt":"2005-03-19T04:36:07","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/2005\/03\/19\/auto_increment-keys-in-mysql\/"},"modified":"2005-04-18T02:55:30","modified_gmt":"2005-04-17T23:55:30","slug":"auto_increment-keys-in-mysql","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2005\/03\/19\/auto_increment-keys-in-mysql\/","title":{"rendered":"AUTO_INCREMENT keys in MySQL"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>For ages I have been using AUTO_INCREMENT keys in <a href=\"http:\/\/www.mysql.com\">MySQL<\/a>.  All of my projects needed either a unique numeric id, which is perfectly taken care of by AUTO_INCREMENT or non-numeric key which I was generating myself.  Today I found myself in a situation where I needed to import some data into a table that has a unique numeric key generated by AUTO_INCREMENT.  I was confused for a second.  I didn&#8217;t know how to combine the provided keys from the data to be imported together with the incremental keys of the table itself.  It turned out that everything is much simplier than I thought.  If a key value is provided when creating a record, MySQL will use it; otherwise it will generate one using an AUTO_INCREMENT feature.<\/p>\n<p>Now I am trying to understand how could I live up to this age and not use this feature even once&#8230;<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>For ages I have been using AUTO_INCREMENT keys in MySQL. All of my projects needed either a unique numeric id, which is perfectly taken care of by AUTO_INCREMENT or non-numeric key which I was generating myself. Today I found myself in a situation where I needed to import some data into a table that has &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2005\/03\/19\/auto_increment-keys-in-mysql\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">AUTO_INCREMENT keys in MySQL<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,62],"tags":[],"keyring_services":[],"class_list":["post-8717","post","type-post","status-publish","format-standard","hentry","category-general","category-technology"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":11605,"url":"https:\/\/mamchenkov.net\/wordpress\/2009\/06\/24\/understanding-wordpress-database-in-10-minutes\/","url_meta":{"origin":8717,"position":0},"title":"Understanding WordPress database in 10 minutes","author":"Leonid Mamchenkov","date":"June 24, 2009","format":false,"excerpt":"Almost two years ago I wrote a blog post titled \"A look inside the WordPress database\".\u00a0 While a lot of people enjoyed it (and, apparently still do, even though it's a bit outdated), I think it could be greatly simplified.\u00a0 And it will probably take you less time to understand\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12480,"url":"https:\/\/mamchenkov.net\/wordpress\/2010\/04\/21\/unit-tests-with-cakephp\/","url_meta":{"origin":8717,"position":1},"title":"Unit tests with CakePHP","author":"Leonid Mamchenkov","date":"April 21, 2010","format":false,"excerpt":"I've spent a large part of yesterday setting up the testing environment for a CakePHP project.\u00a0 As always, every time I do something that I have done before, I wanted to do it better, using all the experienced that was acquired previously.\u00a0 And this often leads to the discovery of\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28362,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/02\/04\/encrypt-mysql-data-using-aes-technique\/","url_meta":{"origin":8717,"position":2},"title":"Encrypt MySQL data using AES technique","author":"Leonid Mamchenkov","date":"February 4, 2018","format":false,"excerpt":"I came across this blog post from a while back, which demonstrates how to use AES encryption for the data in MySQL database. This seems rather easy and straightforward (apart from a little calculation one needs to do for the VARBINARY field types).\u00a0 The only thing that I'm concerned about\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":48046,"url":"https:\/\/mamchenkov.net\/wordpress\/2020\/03\/30\/mysql-json-indexing-and-generated-columns\/","url_meta":{"origin":8717,"position":3},"title":"MySQL, JSON, indexing and generated columns","author":"Leonid Mamchenkov","date":"March 30, 2020","format":false,"excerpt":"For quite some time now I wanted to play around with the recently added JSON type in MySQL.\u00a0 Finally, I have a project where MySQL version is high enough to support it, and the requirements are such that this choice makes sense. The first impression was great - JSON type\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":28508,"url":"https:\/\/mamchenkov.net\/wordpress\/2018\/04\/20\/mysql-8-0-release\/","url_meta":{"origin":8717,"position":4},"title":"MySQL 8.0 release","author":"Leonid Mamchenkov","date":"April 20, 2018","format":false,"excerpt":"MySQL 8.0 has been released and it brings the following new features, enhancements, and more: SQL\u00a0Window functions, Common Table Expressions, NOWAIT and SKIP LOCKED, Descending Indexes, Grouping, Regular Expressions, Character Sets, Cost Model, and Histograms. JSON\u00a0Extended syntax, new functions, improved sorting, and partial updates. With JSON table functions you can\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":25003,"url":"https:\/\/mamchenkov.net\/wordpress\/2015\/11\/30\/house-of-keys\/","url_meta":{"origin":8717,"position":5},"title":"House of Keys","author":"Leonid Mamchenkov","date":"November 30, 2015","format":false,"excerpt":"Here's yet another research confirming how much of a myth online security really is - \"House of Keys: Industry-Wide HTTPS Certificate and SSH Key Reuse Endangers Millions of Devices Worldwide\": We have correlated our data with data from Internet-wide scans (Scans.io and Censys.io) and found that our data set (580\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/8717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=8717"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/8717\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=8717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=8717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=8717"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=8717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}