Forum
Welcome, Guest
Please Login to access forum.
Double Primary Key when importing to the new database. (1 viewing) 
Go to bottom
TOPIC: Double Primary Key when importing to the new database.
#4192
Bertrand Couvin
Junior Boarder
Posts: 21
User Offline
Double Primary Key when importing to the new database. Karma: 0  
Hello,

I have a big problem when exporting and importing to the new database. I have a error related to the double primary key for those tables below:

#_jchat_banned_users
#_jchat_public_sessionrelations
#_jchat_webrtc
#_jchat_webrtc_conference

I can not import those tables and got an mysql error #1071 (Specified key was too long; max key length is 1000 bytes)
I can not change them manually in phpmyadmin. What do I need to do?

remark: MySQL version is 5.5 and engine=MyISAM


Regards
 
Logged Logged  
  The administrator has disabled public write access.
#4193
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:Double Primary Key when importing to the new database. Karma: 79  
Hello,

the problem seems that your MySQL is not configured to support long primary keys.
Normally this is the default can be changed by phpmyadmin or by the hosting itself.

To fix you could try to change the query for tables to not exceed your limit and change from 255 to a lower limit for example 100 such as the following:

CREATE TABLE IF NOT EXISTS `#__jchat_banned_users` (
`banning` VARCHAR( 100 ) NOT NULL,
`banned` VARCHAR( 100 ) NOT NULL,
PRIMARY KEY (`banning`, `banned`)
) ENGINE=InnoDB CHARACTER SET `utf8`;

CREATE TABLE IF NOT EXISTS `#__jchat_public_sessionrelations` (
`ownerid` VARCHAR( 100) NOT NULL,
`contactid` VARCHAR( 100) NOT NULL,
PRIMARY KEY (`ownerid`, `contactid`)
) ENGINE=InnoDB CHARACTER SET `utf8`;


CREATE TABLE IF NOT EXISTS `#__jchat_webrtc` (
`peer1` VARCHAR( 100) NOT NULL,
`peer2` VARCHAR( 100) NOT NULL,
`sdp` TEXT NULL,
`icecandidate` TEXT NULL,
`videocam` tinyint(4) NOT NULL default '1',
PRIMARY KEY (`peer1`, `peer2`)
) ENGINE=InnoDB CHARACTER SET `utf8`;

CREATE TABLE IF NOT EXISTS `#__jchat_webrtc_conference` (
`peer1` VARCHAR( 100) NOT NULL,
`peer2` VARCHAR( 100) NOT NULL,
`sdp` TEXT NULL,
`icecandidate` TEXT NULL,
`videocam` tinyint(4) NOT NULL default '1',
`other_peers` TEXT NULL,
PRIMARY KEY (`peer1`, `peer2`)
) ENGINE=InnoDB CHARACTER SET `utf8`;

CREATE TABLE IF NOT EXISTS `#__jchat_webrtc_blackboard` (
`peer1` VARCHAR( 100 ) NOT NULL,
`peer2` VARCHAR( 100 ) NOT NULL,
`sdp` TEXT NULL,
`icecandidate` TEXT NULL,
PRIMARY KEY (`peer1`, `peer2`)
) ENGINE=InnoDB CHARACTER SET `utf8`;

Regards
 
Logged Logged  
  The administrator has disabled public write access.
Go to top