Magento 2 Admin login ProblemMagento 2 Admin Login ErrorMagento2 admin after login redirect back to admin login?Imported products show up in backend but not on front endMagento 2 - Adding 2 (or more) configurable products to cart with custom options causes Integrity constraint violationMagento 2 Insert data to table that contain foreign key error SQLSTATE[23000]: Integrity constraint violationIntegrity constraint violation error when saving product (google experiments on)Magento 2: Creating product with custom OptionsMagento v2.1.7 admin login errorData Migration From Magento 1.9.1 to 2.1.9Random integrity constraint errors saving orders in Magento 2.1 after payment

How can a new country break out from a developed country without war?

How to preserve electronics (computers, ipads, phones) for hundreds of years?

Would a primitive species be able to learn English from reading books alone?

When is the exact date for EOL of Ubuntu 14.04 LTS?

Should I warn a new PhD Student?

How do I lift the insulation blower into the attic?

"Oh no!" in Latin

Is there a POSIX way to shutdown a UNIX machine?

Did I make a mistake by ccing email to boss to others?

Error in master's thesis, I do not know what to do

Started in 1987 vs. Starting in 1987

Why is implicit conversion not ambiguous for non-primitive types?

Are hand made posters acceptable in Academia?

Trouble reading roman numeral notation with flats

Checking @@ROWCOUNT failing

Should a narrator ever describe things based on a character's view instead of facts?

What should be the ideal length of sentences in a blog post for ease of reading?

Reasons for having MCU pin-states default to pull-up/down out of reset

What is it called when someone votes for an option that's not their first choice?

Why does the frost depth increase when the surface temperature warms up?

Why can't I get pgrep output right to variable on bash script?

Air travel with refrigerated insulin

Why didn’t Eve recognize the little cockroach as a living organism?

Why do Radio Buttons not fill the entire outer circle?



Magento 2 Admin login Problem


Magento 2 Admin Login ErrorMagento2 admin after login redirect back to admin login?Imported products show up in backend but not on front endMagento 2 - Adding 2 (or more) configurable products to cart with custom options causes Integrity constraint violationMagento 2 Insert data to table that contain foreign key error SQLSTATE[23000]: Integrity constraint violationIntegrity constraint violation error when saving product (google experiments on)Magento 2: Creating product with custom OptionsMagento v2.1.7 admin login errorData Migration From Magento 1.9.1 to 2.1.9Random integrity constraint errors saving orders in Magento 2.1 after payment













3















I am able to login to the admin control panel the first time and when I logout and login again it get this message:




There has been an error processing your request
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY', query was: INSERT INTO `admin_user_session` (`session_id`, `user_id`, `status`, `ip`) VALUES (?, ?, ?, ?)




But this works again when I get the empty ADMIN_USER_SESSION table in PHPMyAdmin.










share|improve this question




























    3















    I am able to login to the admin control panel the first time and when I logout and login again it get this message:




    There has been an error processing your request
    SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY', query was: INSERT INTO `admin_user_session` (`session_id`, `user_id`, `status`, `ip`) VALUES (?, ?, ?, ?)




    But this works again when I get the empty ADMIN_USER_SESSION table in PHPMyAdmin.










    share|improve this question


























      3












      3








      3








      I am able to login to the admin control panel the first time and when I logout and login again it get this message:




      There has been an error processing your request
      SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY', query was: INSERT INTO `admin_user_session` (`session_id`, `user_id`, `status`, `ip`) VALUES (?, ?, ?, ?)




      But this works again when I get the empty ADMIN_USER_SESSION table in PHPMyAdmin.










      share|improve this question
















      I am able to login to the admin control panel the first time and when I logout and login again it get this message:




      There has been an error processing your request
      SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY', query was: INSERT INTO `admin_user_session` (`session_id`, `user_id`, `status`, `ip`) VALUES (?, ?, ?, ?)




      But this works again when I get the empty ADMIN_USER_SESSION table in PHPMyAdmin.







      magento-2.1






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 13 mins ago









      Teja Bhagavan Kollepara

      3,00641949




      3,00641949










      asked Dec 5 '17 at 0:06









      VenkateshaVenkatesha

      545




      545




















          3 Answers
          3






          active

          oldest

          votes


















          0














          MAKE SURE YOU HAVE A DB BACKUP



          You can verify that your admin_user_session table has the primary key set to auto-increment with this query:



          SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA 'magento_db' AND TABLE_NAME = 'admin_user_session';


          If you see that auto-increment is turned off, then you can fix it with this query:



          ALTER TABLE 'admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT;


          However, if you need to do that, that is a good indication that either your DB import failed or you have some custom functionality with admin sessions that is blocking the auto-increment functionality.






          share|improve this answer






























            0














            Run below query your issue get resolved.



            ALTER TABLE `admin_user_session` MODIFY COLUMN 'session_id' INT AUTO_INCREMENT;





            share|improve this answer






























              0














              CODE USED:



              SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA 'magento_db' AND TABLE_NAME = 'admin_user_session' LIMIT 0, 25
              MySQL said: Documentation



              ERROR CODE:



              #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''magento_db' AND TABLE_NAME = 'admin_user_session' LIMIT 0, 25' at line 1



              And when i tried to ALTER:




              CODE USED:
              ALTER TABLE 'admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT;



              ERROR CODE:



              #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT' at line 1





              share|improve this answer
























                Your Answer








                StackExchange.ready(function()
                var channelOptions =
                tags: "".split(" "),
                id: "479"
                ;
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function()
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled)
                StackExchange.using("snippets", function()
                createEditor();
                );

                else
                createEditor();

                );

                function createEditor()
                StackExchange.prepareEditor(
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: false,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: null,
                bindNavPrevention: true,
                postfix: "",
                imageUploader:
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                ,
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                );



                );













                draft saved

                draft discarded


















                StackExchange.ready(
                function ()
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f204412%2fmagento-2-admin-login-problem%23new-answer', 'question_page');

                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                0














                MAKE SURE YOU HAVE A DB BACKUP



                You can verify that your admin_user_session table has the primary key set to auto-increment with this query:



                SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA 'magento_db' AND TABLE_NAME = 'admin_user_session';


                If you see that auto-increment is turned off, then you can fix it with this query:



                ALTER TABLE 'admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT;


                However, if you need to do that, that is a good indication that either your DB import failed or you have some custom functionality with admin sessions that is blocking the auto-increment functionality.






                share|improve this answer



























                  0














                  MAKE SURE YOU HAVE A DB BACKUP



                  You can verify that your admin_user_session table has the primary key set to auto-increment with this query:



                  SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA 'magento_db' AND TABLE_NAME = 'admin_user_session';


                  If you see that auto-increment is turned off, then you can fix it with this query:



                  ALTER TABLE 'admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT;


                  However, if you need to do that, that is a good indication that either your DB import failed or you have some custom functionality with admin sessions that is blocking the auto-increment functionality.






                  share|improve this answer

























                    0












                    0








                    0







                    MAKE SURE YOU HAVE A DB BACKUP



                    You can verify that your admin_user_session table has the primary key set to auto-increment with this query:



                    SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA 'magento_db' AND TABLE_NAME = 'admin_user_session';


                    If you see that auto-increment is turned off, then you can fix it with this query:



                    ALTER TABLE 'admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT;


                    However, if you need to do that, that is a good indication that either your DB import failed or you have some custom functionality with admin sessions that is blocking the auto-increment functionality.






                    share|improve this answer













                    MAKE SURE YOU HAVE A DB BACKUP



                    You can verify that your admin_user_session table has the primary key set to auto-increment with this query:



                    SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA 'magento_db' AND TABLE_NAME = 'admin_user_session';


                    If you see that auto-increment is turned off, then you can fix it with this query:



                    ALTER TABLE 'admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT;


                    However, if you need to do that, that is a good indication that either your DB import failed or you have some custom functionality with admin sessions that is blocking the auto-increment functionality.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 5 '17 at 0:53









                    HaydenFromITHaydenFromIT

                    362




                    362























                        0














                        Run below query your issue get resolved.



                        ALTER TABLE `admin_user_session` MODIFY COLUMN 'session_id' INT AUTO_INCREMENT;





                        share|improve this answer



























                          0














                          Run below query your issue get resolved.



                          ALTER TABLE `admin_user_session` MODIFY COLUMN 'session_id' INT AUTO_INCREMENT;





                          share|improve this answer

























                            0












                            0








                            0







                            Run below query your issue get resolved.



                            ALTER TABLE `admin_user_session` MODIFY COLUMN 'session_id' INT AUTO_INCREMENT;





                            share|improve this answer













                            Run below query your issue get resolved.



                            ALTER TABLE `admin_user_session` MODIFY COLUMN 'session_id' INT AUTO_INCREMENT;






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Sep 19 '18 at 14:02









                            Prashant ValandaPrashant Valanda

                            9,82412355




                            9,82412355





















                                0














                                CODE USED:



                                SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA 'magento_db' AND TABLE_NAME = 'admin_user_session' LIMIT 0, 25
                                MySQL said: Documentation



                                ERROR CODE:



                                #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''magento_db' AND TABLE_NAME = 'admin_user_session' LIMIT 0, 25' at line 1



                                And when i tried to ALTER:




                                CODE USED:
                                ALTER TABLE 'admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT;



                                ERROR CODE:



                                #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT' at line 1





                                share|improve this answer





























                                  0














                                  CODE USED:



                                  SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA 'magento_db' AND TABLE_NAME = 'admin_user_session' LIMIT 0, 25
                                  MySQL said: Documentation



                                  ERROR CODE:



                                  #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''magento_db' AND TABLE_NAME = 'admin_user_session' LIMIT 0, 25' at line 1



                                  And when i tried to ALTER:




                                  CODE USED:
                                  ALTER TABLE 'admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT;



                                  ERROR CODE:



                                  #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT' at line 1





                                  share|improve this answer



























                                    0












                                    0








                                    0







                                    CODE USED:



                                    SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA 'magento_db' AND TABLE_NAME = 'admin_user_session' LIMIT 0, 25
                                    MySQL said: Documentation



                                    ERROR CODE:



                                    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''magento_db' AND TABLE_NAME = 'admin_user_session' LIMIT 0, 25' at line 1



                                    And when i tried to ALTER:




                                    CODE USED:
                                    ALTER TABLE 'admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT;



                                    ERROR CODE:



                                    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT' at line 1





                                    share|improve this answer















                                    CODE USED:



                                    SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA 'magento_db' AND TABLE_NAME = 'admin_user_session' LIMIT 0, 25
                                    MySQL said: Documentation



                                    ERROR CODE:



                                    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''magento_db' AND TABLE_NAME = 'admin_user_session' LIMIT 0, 25' at line 1



                                    And when i tried to ALTER:




                                    CODE USED:
                                    ALTER TABLE 'admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT;



                                    ERROR CODE:



                                    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''admin_user_session' MODIFY COLUMN 'session_id' INT NOT NULL AUTO_INCREMENT' at line 1






                                    share|improve this answer














                                    share|improve this answer



                                    share|improve this answer








                                    edited 14 mins ago









                                    Teja Bhagavan Kollepara

                                    3,00641949




                                    3,00641949










                                    answered Dec 7 '17 at 5:31









                                    VenkateshaVenkatesha

                                    545




                                    545



























                                        draft saved

                                        draft discarded
















































                                        Thanks for contributing an answer to Magento Stack Exchange!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid


                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.

                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f204412%2fmagento-2-admin-login-problem%23new-answer', 'question_page');

                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php scriptMagento 2: User cant logged in into to account page, no error showing!Magento duplicate on subdomainGrabbing storeview from cookie (after using language selector)How do I run php custom script on magento2Magento 2: Include PHP script in headerSession lock after using Cm_RedisSessionscript php to update stockMagento set cookie popupMagento 2 session id cookie - where to find it?How to import Configurable product from csv with custom attributes using php scriptMagento 2 run custom PHP script

                                        Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

                                        How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2