Basically what I want is a working version of the following code:
ALTER TABLE table_name
AUTO_INCREMENT =
(
SELECT
`AUTO_INCREMENT`
FROM
INFORMATION_SCHEMA.TABLES
WHERE
TABLE_SCHEMA = 'database_name'
AND TABLE_NAME = 'another_table_name'
);
Error:
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 'AUTO_INCREMENT =
Cause:
According to MySQL Doc :
InnoDB uses an auto-increment counter in memory provided that the server runs. When the server stops and restarts, InnoDB reinitializes the counter for each table for the first INSERT for the table, as described previously.
This means that whenever I restart the server, my auto_increment values ββare set to the lowest possible value.
ticket, - ticket_backup. id, . ticket . , ticket ticket_backup, ticket. 56 thousand ( ticket_backup) 0 . ALTER TABLE, , , id 1, , ticket_backup, , . , , - .