Home > database >  Repeat problem mysql small white, the primary key
Repeat problem mysql small white, the primary key

Time:03-24

I am running a letter software pasa primary key repeat problem, consult how to solve, thank!
DBD: : mysql: : db do failed: Duplicate entry 'asmbl_8 - f3p0 for key' PRIMARY 'at/home/softwares/PASApipeline v2.4.1 PerlLib//DB_connect PM line 221.
Failed query: & lt; Insert into asmbl_link (asmbl_acc cdna_acc) values (?,?,?,?,? ,?)> Values: asmbl_8 f3p0
Errors: Duplicate entry 'asmbl_8 - f3p0 for key' PRIMARY '

I locate to DB_connect. The PM line 221 statement is:
Sub RunMod {
211 my ($dbproc, $query, @ values)=@ _;
212 my ($result);
213
214 the if ($: : DEBUG | | $: : DB_SEE) {print "QUERY: $QUERY \ tVALUES: @ values \ n"; }
215 the if ($: : DEBUG) {
$result=216 "NOT READY";
The else {217}
218 the eval {
219 {
The lock $220 LOCKVAR;
221 $dbproc - & gt; {DBH} - & gt; Do ($query, undef, @ values);
222}
223};
224 the if ($@) {# error occurred
225
226 # # check for mysql gone away:
227 the if ($DBI: : errstr=~/server has gone away | Lost connection/) {
228 # # reestablish connection and try again:
229 & amp; Reconnect_to_server ($dbproc);
230 the return (& amp; RunMod ($dbproc, $query, @ values));

CodePudding user response:

You can use the mysql update this syntax the primary key of the conflict
  • Related