{"id":8468,"date":"2020-12-14T04:50:00","date_gmt":"2020-12-14T04:50:00","guid":{"rendered":"https:\/\/ubiq.co\/tech-blog\/?p=8468"},"modified":"2025-08-29T04:53:39","modified_gmt":"2025-08-29T04:53:39","slug":"how-to-remove-not-null-constraint-in-mysql","status":"publish","type":"post","link":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/","title":{"rendered":"How to Remove Not Null Constraint in MySQL"},"content":{"rendered":"\n<p>NOT NULL column constraint prevents users from assigning null values to the column. They are useful for disallowing null values from creeping into your database. But sometimes you may need to remove NOT NULL constraint in MySQL. For example, occasionally you may need to enter null data values in your table. MySQL allows you to drop NOT NULL constraint in MySQL using ALTER TABLE &#8230; MODIFY statement. In this article, we will look at how to remove NOT NULL constraint in MySQL.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#How_to_Remove_Not_Null_Constraint_in_MySQL\" >How to Remove Not Null Constraint in MySQL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#Example_1\" >Example #1<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#Example_2\" >Example #2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#Example_3\" >Example #3<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#Example_4\" >Example #4<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#Example_5\" >Example #5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Remove_Not_Null_Constraint_in_MySQL\"><\/span>How to Remove Not Null Constraint in MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Here are the steps to remove NOT NULL constraint in MySQL. Here is the syntax of ALTER TABLE statement to remove Not Null constraint.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>alter table<\/strong> table_name <strong>modify<\/strong> full_column_definition;<br>OR<br><strong>alter table<\/strong> table_name <strong>modify column<\/strong> full_column_definition;<\/pre>\n\n\n\n<p>In the above SQL query you need to specify table name, and also the full definition of column whose NOT NULL constraint you want to remove, after MODIFY keyword. While specifying column definition, we do not specify NOT NULL constraint.<\/p>\n\n\n\n<p>Let us look at a few examples.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_1\"><\/span>Example #1<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>For example, let us say you have a table <em>sales(id, order_date, amount)<\/em>. Here amount column has int data type with not null constraint.<\/p>\n\n\n\n<pre id=\"block-2ec728ba-bc15-4517-b406-ba1cdc8edc10\" class=\"wp-block-preformatted\">mysql&gt; <code>create table sales (   <\/code><br>   <code>id int primary key,   <\/code><br>   order_date date,<br>   <code>amount int <strong>not null<\/strong><\/code><br><code>);<\/code><br><br>mysql&gt; describe sales;<br>+------------+---------+------+-----+---------+-------+<br>| Field      | Type    | Null | Key | Default | Extra |<br>+------------+---------+------+-----+---------+-------+<br>| id         | int(11) | NO   | PRI | NULL    |       |<br>| order_date | date    | YES  |     | NULL    |       |<br><strong>| amount     | int(11) | NO   |     | NULL    |       |<\/strong><br>+------------+---------+------+-----+---------+-------+<\/pre>\n\n\n\n<p>Here is the SQL query to remove NOT NULL constraint from <em>amount<\/em> column.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; alter table sales modify amount int;<br><br>mysql&gt; describe sales;<br>+------------+---------+------+-----+---------+-------+<br>| Field      | Type    | Null | Key | Default | Extra |<br>+------------+---------+------+-----+---------+-------+<br>| id         | int(11) | NO   | PRI | NULL    |       |<br>| order_date | date    | YES  |     | NULL    |       |<br><strong>| amount     | int(11) | YES  |     | NULL    |       |<\/strong><br>+------------+---------+------+-----+---------+-------+<\/pre>\n\n\n\n<p>We specify <em>amount<\/em> column&#8217;s full definition, but without NOT NULL constraint. As you can see in the output of describe command, amount column&#8217;s default value is NULL.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_2\"><\/span>Example #2<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>As mentioned earlier, while removing NOT NULL constraint you need to restate the full column definition. Otherwise, undeclared attributes will return to their default settings. <\/p>\n\n\n\n<p>For example, let us say you have the following <em>sales<\/em> table such that <em>amount<\/em> column has NOT NULL constraint as well as default value of 0.<\/p>\n\n\n\n<pre id=\"block-973666d7-0eb0-4078-b7d9-4b45ea6e8fce\" class=\"wp-block-preformatted\"><code>create table sales (   <\/code>\n   <code>id int primary key,   <\/code>\n   order_date date,\n   <code>amount int <strong>not null<\/strong><\/code> <strong>default 0<\/strong>\n<code>);<\/code><\/pre>\n\n\n\n<p>Here is the syntax to remove NOT NULL constraint from sales table.<\/p>\n\n\n\n<pre id=\"block-73e8ff5e-b658-4030-9408-b19e3570f9c8\" class=\"wp-block-preformatted\">alter table sales modify amount int <strong>default 0<\/strong>;<\/pre>\n\n\n\n<p>As you can see, we have continued to specify default value for <em>amount<\/em> column in our SQL query.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_3\"><\/span>Example #3<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>By default, <a href=\"https:\/\/www.w3schools.com\/sql\/sql_primarykey.ASP\" target=\"_blank\" rel=\"noreferrer noopener\">primary key<\/a> columns cannot have null values. Even if you do not specify a NOT NULL constraint during table definition, it is automatically added. But you can still remove this constraint from primary key column as shown below, using alter table&#8230;modify statement.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; alter table sales modify id int;<br><br>mysql&gt; describe sales;<br>+------------+---------+------+-----+---------+-------+<br>| Field      | Type    | Null | Key | Default | Extra |<br>+------------+---------+------+-----+---------+-------+<br><strong>| id         | int(11) | NO   | PRI | 0       |       |<\/strong><br>| order_date | date    | YES  |     | NULL    |       |<br>| amount     | int(11) | YES  |     | NULL    |       |<br>+------------+---------+------+-----+---------+-------+<\/pre>\n\n\n\n<p>Please note, when you remove NOT NULL constraint from primary key column, its default value is set to 0, and not NULL, as shown above.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_4\"><\/span>Example #4<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Similarly, foreign keys also have a NOT NULL constraint in most cases. In the following example, order_num is a foreign key with a not null constraint. Nevertheless, you can remove this constraint also using ALTER TABLE statement.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; CREATE TABLE orders (<br>         order_id int,<br>         <strong>order_num int not null,<\/strong><br>         pid int,<br>         PRIMARY KEY (order_id),<br>         FOREIGN KEY (order_num) REFERENCES sales(id)<br>     );<br><br>mysql&gt; describe orders;<br>+-----------+---------+------+-----+---------+-------+<br>| Field     | Type    | Null | Key | Default | Extra |<br>+-----------+---------+------+-----+---------+-------+<br>| order_id  | int(11) | NO   | PRI | 0       |       |<br><strong>| order_num | int(11) | NO   | MUL | NULL    |       |<\/strong><br>| pid       | int(11) | YES  |     | NULL    |       |<br>+-----------+---------+------+-----+---------+-------+<br><br>mysql&gt; alter table orders modify order_num int;<br><br>mysql&gt; describe orders;<br>+-----------+---------+------+-----+---------+-------+<br>| Field     | Type    | Null | Key | Default | Extra |<br>+-----------+---------+------+-----+---------+-------+<br>| order_id  | int(11) | NO   | PRI | 0       |       |<br><strong>| order_num | int(11) | YES  | MUL | NULL    |       |<\/strong><br>| pid       | int(11) | YES  |     | NULL    |       |<br>+-----------+---------+------+-----+---------+-------+<br><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Example_5\"><\/span>Example #5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you want to add back the NOT NULL constraint, you can use the same alter table&#8230;modify statement, with NOT NULL constraint in column definition.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql&gt; alter table sales modify column amount int not null;<br><br>mysql&gt; describe sales;<br>+------------+---------+------+-----+---------+-------+<br>| Field      | Type    | Null | Key | Default | Extra |<br>+------------+---------+------+-----+---------+-------+<br>| id         | int(11) | NO   | PRI | NULL    |       |<br>| order_date | date    | YES  |     | NULL    |       |<br><strong>| amount     | int(11) | NO   |     | NULL    |       |<\/strong><br>+------------+---------+------+-----+---------+-------+<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this article, we have learnt how to remove NOT NULL constraint in MySQL. using ALTER TABLE&#8230;MODIFY statement. You can also use it on all column data types where you have <a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-alter-column-from-null-to-not-null\/\">altered column from NULL to NOT NULL<\/a>. Please remember to mention MODIFY keyword between table name and column definition. Also remember to specify the full column definition after MODIFY keyword, without NOT NULL constraint in it. However, please remember, it is not a good practice to remove NOT NULL constraints if they have already been set during table definition. Therefore, it is recommended to add back NOT NULL constraint after you are done with null data entry\/modifications.<\/p>\n\n\n\n<p>Need a reporting tool for MySQL? <a href=\"http:\/\/ubiq.co\/\">Ubiq<\/a>&nbsp;makes it easy to visualize data in minutes, and monitor in real-time dashboards.&nbsp;<a href=\"http:\/\/ubiq.co\/accounts\/register\">Try it<\/a>&nbsp;Today!<\/p>\n\n\n\n<p>Also read:<br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-default-value-of-column-in-mysql\/\">How to Remove Default Value of Column in MySQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-round-timestamp-in-mysql\/\">How to Remove Timestamp in MySQL<\/a><br><a href=\"https:\/\/ubiq.co\/tech-blog\/how-to-rename-table-in-mysql\/\">How to Rename Table in MySQL<\/a><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL allows you to remove NOT NULL constraint in MySQL. Here is how to remove NOT NULL constraint in MySQL.<\/p>\n","protected":false},"author":1,"featured_media":8470,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[324],"tags":[465],"class_list":["post-8468","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql","tag-remove-not-null-constraint"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Remove Not Null Constraint in MySQL - Ubiq BI<\/title>\n<meta name=\"description\" content=\"MySQL allows you to remove NOT NULL constraint in MySQL. Here is how to remove NOT NULL constraint in MySQL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Remove Not Null Constraint in MySQL - Ubiq BI\" \/>\n<meta property=\"og:description\" content=\"MySQL allows you to remove NOT NULL constraint in MySQL. Here is how to remove NOT NULL constraint in MySQL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/\" \/>\n<meta property=\"og:site_name\" content=\"Ubiq BI\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ubiqbi\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-14T04:50:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-29T04:53:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/remove-not-null-constraint-mysql.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"730\" \/>\n\t<meta property=\"og:image:height\" content=\"410\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Sreeram Sreenivasan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:site\" content=\"@UbiqBI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sreeram Sreenivasan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/\"},\"author\":{\"name\":\"Sreeram Sreenivasan\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"headline\":\"How to Remove Not Null Constraint in MySQL\",\"datePublished\":\"2020-12-14T04:50:00+00:00\",\"dateModified\":\"2025-08-29T04:53:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/\"},\"wordCount\":611,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/remove-not-null-constraint-mysql.webp?fit=730%2C410&ssl=1\",\"keywords\":[\"remove not null constraint\"],\"articleSection\":[\"MySQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/\",\"url\":\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/\",\"name\":\"How to Remove Not Null Constraint in MySQL - Ubiq BI\",\"isPartOf\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/remove-not-null-constraint-mysql.webp?fit=730%2C410&ssl=1\",\"datePublished\":\"2020-12-14T04:50:00+00:00\",\"dateModified\":\"2025-08-29T04:53:39+00:00\",\"author\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\"},\"description\":\"MySQL allows you to remove NOT NULL constraint in MySQL. Here is how to remove NOT NULL constraint in MySQL.\",\"breadcrumb\":{\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/remove-not-null-constraint-mysql.webp?fit=730%2C410&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/remove-not-null-constraint-mysql.webp?fit=730%2C410&ssl=1\",\"width\":730,\"height\":410,\"caption\":\"remove not null constraint in mysql\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ubiq.co\/tech-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Remove Not Null Constraint in MySQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#website\",\"url\":\"https:\/\/ubiq.co\/tech-blog\/\",\"name\":\"Ubiq BI\",\"description\":\"Build dashboards &amp; reports in minutes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc\",\"name\":\"Sreeram Sreenivasan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g\",\"caption\":\"Sreeram Sreenivasan\"},\"description\":\"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/\"],\"url\":\"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Remove Not Null Constraint in MySQL - Ubiq BI","description":"MySQL allows you to remove NOT NULL constraint in MySQL. Here is how to remove NOT NULL constraint in MySQL.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/","og_locale":"en_US","og_type":"article","og_title":"How to Remove Not Null Constraint in MySQL - Ubiq BI","og_description":"MySQL allows you to remove NOT NULL constraint in MySQL. Here is how to remove NOT NULL constraint in MySQL.","og_url":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/","og_site_name":"Ubiq BI","article_publisher":"https:\/\/www.facebook.com\/ubiqbi","article_published_time":"2020-12-14T04:50:00+00:00","article_modified_time":"2025-08-29T04:53:39+00:00","og_image":[{"width":730,"height":410,"url":"https:\/\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/remove-not-null-constraint-mysql.webp","type":"image\/webp"}],"author":"Sreeram Sreenivasan","twitter_card":"summary_large_image","twitter_creator":"@UbiqBI","twitter_site":"@UbiqBI","twitter_misc":{"Written by":"Sreeram Sreenivasan","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#article","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/"},"author":{"name":"Sreeram Sreenivasan","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"headline":"How to Remove Not Null Constraint in MySQL","datePublished":"2020-12-14T04:50:00+00:00","dateModified":"2025-08-29T04:53:39+00:00","mainEntityOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/"},"wordCount":611,"commentCount":0,"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/remove-not-null-constraint-mysql.webp?fit=730%2C410&ssl=1","keywords":["remove not null constraint"],"articleSection":["MySQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/","url":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/","name":"How to Remove Not Null Constraint in MySQL - Ubiq BI","isPartOf":{"@id":"https:\/\/ubiq.co\/tech-blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#primaryimage"},"image":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/remove-not-null-constraint-mysql.webp?fit=730%2C410&ssl=1","datePublished":"2020-12-14T04:50:00+00:00","dateModified":"2025-08-29T04:53:39+00:00","author":{"@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc"},"description":"MySQL allows you to remove NOT NULL constraint in MySQL. Here is how to remove NOT NULL constraint in MySQL.","breadcrumb":{"@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#primaryimage","url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/remove-not-null-constraint-mysql.webp?fit=730%2C410&ssl=1","contentUrl":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/remove-not-null-constraint-mysql.webp?fit=730%2C410&ssl=1","width":730,"height":410,"caption":"remove not null constraint in mysql"},{"@type":"BreadcrumbList","@id":"https:\/\/ubiq.co\/tech-blog\/how-to-remove-not-null-constraint-in-mysql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ubiq.co\/tech-blog\/"},{"@type":"ListItem","position":2,"name":"How to Remove Not Null Constraint in MySQL"}]},{"@type":"WebSite","@id":"https:\/\/ubiq.co\/tech-blog\/#website","url":"https:\/\/ubiq.co\/tech-blog\/","name":"Ubiq BI","description":"Build dashboards &amp; reports in minutes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ubiq.co\/tech-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ubiq.co\/tech-blog\/#\/schema\/person\/db98d49a766a3a111d8510935ab90abc","name":"Sreeram Sreenivasan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b3127ed2d4bb8efb3fa0bbb52cf2efd4d0156c97fc05a503537c883e8279947?s=96&d=mm&r=g","caption":"Sreeram Sreenivasan"},"description":"Sreeram Sreenivasan is the Founder of Ubiq. He has helped many Fortune 500 companies in the areas of BI &amp; software development.","sameAs":["https:\/\/www.linkedin.com\/in\/sreeram-sreenivasan\/"],"url":"https:\/\/ubiq.co\/tech-blog\/author\/wordpress\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ubiq.co\/tech-blog\/wp-content\/uploads\/2020\/12\/remove-not-null-constraint-mysql.webp?fit=730%2C410&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pbGGTT-2cA","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/comments?post=8468"}],"version-history":[{"count":6,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8468\/revisions"}],"predecessor-version":[{"id":9352,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/posts\/8468\/revisions\/9352"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media\/8470"}],"wp:attachment":[{"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/media?parent=8468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/categories?post=8468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubiq.co\/tech-blog\/wp-json\/wp\/v2\/tags?post=8468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}