[support] Database problem

Steve Kessler skessler at denverdataman.com
Thu Dec 25 16:41:41 UTC 2008


The problem is the max numbers but this command 

alter table accesslog auto_increment=VALUE+1;

does not work " #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 'VALUE+1' at line 1".  Where should I be putting aid (the field
name) to make this SQL statement execute. 

Thanks,
Steve

Steve Kessler 
Denver DataMan 
303-587-4428 
Sign up for the Denver DataMan Free eNewsletter

-----Original Message-----
From: Craig Forbes [mailto:cpforbes at gmail.com] 
Sent: Tuesday, December 23, 2008 1:56 AM
To: support at drupal.org
Subject: Re: [support] Database problem

I can't be sure but from your limited description, I'm guessing that
somehow you have gotten your auto increment values out of sync with
the maximum value in that table.

I'm not sure what column is the auto_increment column in that table
but if that is the problem here is the solution:

NOTE: Before attempting this solution backup your database if you
haven't already. In fact, even if you already have backed it up back
it up again before attempting this.

1) figure out what the max value for the auto_increment columns is:
select max(COLNAME) from accesslog;

note the result.

2) To check if this is the problem you can use this command:
show table status like 'accesslog'

if the auto_increment column is less than the max value noted in step
1 then this is your problem.

3) to reset the auto_increment value:

alter table accesslog auto_increment=VALUE+1;

>From your other problem it seems possible that you have a corrupted
database.  Are you able to do a mysqldump on the database? If not try
to dump each table individually.


 -Craig

On Mon, Dec 22, 2008 at 5:55 PM, Steve Kessler
<skessler at denverdataman.com> wrote:
> I am sorry to resubmit this but I have not head back and the problem is
now
> getting worse.
>
> I am now getting this message if not logged in:
>
> user warning: Duplicate entry '237595' for key 1 query: INSERT INTO
> accesslog (title, path, url, hostname, uid, sid, timer, timestamp)
> values('Affiliate Partner Programs ', 'node/198', '', '24.9.62.24', 1,
> '25c7d7324789e378b9c4fc9c2e66922e', 799, 1229989930) in
> /home/kadimaso/public_html/denverdataman/includes/database.mysql.inc on
line
> 174.
>
> I have tried to repair the tables in PHP My Admin and any help is much
> appreciated.
-- 
[ Drupal support list | http://lists.drupal.org/ ]



More information about the support mailing list