By Jeno1 on
Hi!
My problem is that I've exported my drupal database to a file and imported it to another mysql server.
BUT! however I have several nodes, after importing, the auto_increment value starts from 0.
Is that possible to launch a query through drupal without direct access to the server to alter the auto increment's base value to a specific value?
I have full access to Drupal, but i cannot run a command prompt-like user interface on the server.
Please help!
Jeno1
Comments
ALTER TABLE
You might have to set the auto-increment value on the table if it did not get exported/imported properly. The SQL command looks something like the following:
ALTER TABLE foo AUTO_INCREMENT 42
I think this only works for
I think this only works for InnoDB, but try and report back Jeno.
database administration through drupal
Jeno1, another thing, sending a sql command to the mysql server doesn't need command line access. Usually you can use something like phpmyadmin provided by your webhost. Otherwise, you might try this module: http://drupal.org/project/dba
I'm not the developer for it, but I've used it to some success. When I tried to import/export the entire db through the module, I run into some problems, but for changing some row values or table properties, it might serve your purpose.
As far as mysql help, try these pages:
AUTO_INCREMENT:
http://dev.mysql.com/doc/refman/4.1/en/example-auto-increment.html
ALTER TABLE:
http://dev.mysql.com/doc/refman/4.1/en/alter-table.html
table names
You didn't by any chance rename the tables? I just tripped over this problem yesterday - you'll have to keep the entries in the tables 'sequences' in sync with the table names, otherwise Drupal will start generating new IDs from 0 on...