The database stored procedures are not very skilled, 1:30 will not write out the function, so I simply wrote a program in PHP. More than 10 databases, each library has hundreds of tables, the data are all emptied, but the table's self-increment field value is still retained the original table, to all one-time restore to the original value, if a table a table modification, do not know to change to se years. In the System library query the table name of the database that needs to be modified $sysdbname= "Information_schema"; $dbarray =array ("DB1", "DB2", "DB3", "DB4", "DB5", "DB6", "DB7", " DB8 "," DB9 "," DB10 "), foreach ($dbarray as $v) {//database to be manipulated $dbname= $v; mysql_select_db (" $dbname ") or Die (" Open db FAILED. "); $query = "Select table_name from ' TABLES ' where table_schema= ' {$sysDbName} ' and auto_increment>1 '; $result =mysql_ Query ($query); $totalRows =mysql_num_rows ($result); echo "Shared". $totalRows. "The table needs to initialize the:
Self-increment fields for all tables in the database are initialized