SITE ERROR:
Fatal error: Duplicate entry ‘0′ for key 1 in
/var/www/vhosts/xxxxxx.com/httpdocs/us/store/lib/framework/core/MySQLDatabase.class.php on line 69
CAUSE:
It does means multiple sessions are not allowable to view the site. We can view the page at single session only.
FIX:
In order to fix the problem, we need to set auto_increment value for the table(session) in the databases.
mysql> show databases;
mysql> use DB;
mysql> show tables;
mysql> desc se_session;
+——–+————–+——+—–+————+——-+
| Field | Type | Null | Key | Default | Extra |
+——–+————–+——+—–+————+——-+
| tempId | int(11) | NO | PRI | NULL | |
| token | varchar(35) | NO | MUL | NULL | |
| key | varchar(100) | YES | MUL | NULL | |
| val | longtext | YES | | NULL | |
| date | date | NO | MUL | 0000-00-00 | |
+——–+————–+——+—–+————+——-+
5 rows in set (0.00 sec)
Here, you can see there no auto increment value set for this table.
By achieving auto increment value, just run the below command in mysql commant prompt.
mysql> alter table se_session modify tempId int(11) auto_increment;
Query OK, 1 row affected (0.02 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> desc se_session;
+——–+————–+——+—–+————+—————-+
| Field | Type | Null | Key | Default | Extra |
+——–+————–+——+—–+————+—————-+
| tempId | int(11) | NO | PRI | NULL | auto_increment |
| token | varchar(35) | NO | MUL | NULL | |
| key | varchar(100) | YES | MUL | NULL | |
| val | longtext | YES | | NULL | |
| date | date | NO | MUL | 0000-00-00 | |
+——–+————–+——+—–+————+—————-+
5 rows in set (0.01 sec)
Now autoincrement value added for the session table.
Posted by We3cares