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
What is this high flying aircraft over Pennsylvania?
When is the exact date for EOL of Ubuntu 14.04 LTS?
I keep switching characters, how do I stop?
Output visual diagram of picture
Connection Between Knot Theory and Number Theory
How do I lift the insulation blower into the attic?
Magnifying glass in hyperbolic space
Showing mass murder in a kid's book
Unfrosted light bulb
Can you describe someone as luxurious? As in someone who likes luxurious things?
How would a solely written language work mechanically
Should a narrator ever describe things based on a character's view instead of facts?
Weird lines in Microsoft Word
Are all namekians brothers?
C++ lambda syntax
Why is participating in the European Parliamentary elections used as a threat?
Pre-Employment Background Check With Consent For Future Checks
How do you justify more code being written by following clean code practices?
Air travel with refrigerated insulin
Travelling in US for more than 90 days
How to test the sharpness of a knife?
If the Dominion rule using their Jem'Hadar troops, why is their life expectancy so low?
Reasons for having MCU pin-states default to pull-up/down out of reset
New Order #2: Turn My Way
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
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
add a comment |
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
add a comment |
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
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
magento-2.1
edited 9 mins ago
Teja Bhagavan Kollepara
3,00641949
3,00641949
asked Dec 5 '17 at 0:06
VenkateshaVenkatesha
545
545
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
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.
add a comment |
Run below query your issue get resolved.
ALTER TABLE `admin_user_session` MODIFY COLUMN 'session_id' INT AUTO_INCREMENT;
add a comment |
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Dec 5 '17 at 0:53
HaydenFromITHaydenFromIT
362
362
add a comment |
add a comment |
Run below query your issue get resolved.
ALTER TABLE `admin_user_session` MODIFY COLUMN 'session_id' INT AUTO_INCREMENT;
add a comment |
Run below query your issue get resolved.
ALTER TABLE `admin_user_session` MODIFY COLUMN 'session_id' INT AUTO_INCREMENT;
add a comment |
Run below query your issue get resolved.
ALTER TABLE `admin_user_session` MODIFY COLUMN 'session_id' INT AUTO_INCREMENT;
Run below query your issue get resolved.
ALTER TABLE `admin_user_session` MODIFY COLUMN 'session_id' INT AUTO_INCREMENT;
answered Sep 19 '18 at 14:02
Prashant ValandaPrashant Valanda
9,82412355
9,82412355
add a comment |
add a comment |
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
add a comment |
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
add a comment |
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
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
edited 10 mins ago
Teja Bhagavan Kollepara
3,00641949
3,00641949
answered Dec 7 '17 at 5:31
VenkateshaVenkatesha
545
545
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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