How to view current auto-increment values of database tables

Source: Internet
Author: User

How can I view the current auto-increment values of database tables?

Because the auto-increment field of the database table is unique, after a record is deleted, the auto-increment value of the record actually exists, therefore, if you want to query the current starting value of the auto-increment field of the current table, it is wrong to query it by using select max ('auto-increment field ') from 'table name, I have tried the following methods.

You can use the following statement to query a MySQL database:

Show create table 'table name ';

The following result is displayed:

========================================================== ============================
Create table 'table name '(
...................
) ENGINE = MyISAM AUTO_INCREMENT = 3246 default charset = utf8;

Note that the above 3246 indicates the current auto-increment start value.

When you run the preceding SQL command using phpmyadmin, it is estimated that a scaling result is displayed. Click the option and select the complete text to view the result.

Articles you may be interested in
  • Methods for resetting the auto-increment start value of various MySQL Data Table types
  • Js address bar special effects (display the size of all images with links on the page and view the height of the current browser)
  • How to optimize servers, static databases, and load balancing for high-traffic websites
  • How to view MySQL database character sets
  • How to know that the SQL statements executed in the database are slow
  • Navicat for mysql remote connection to the mySql database prompt 10061,1045 error Solution
  • Use the PHP function memory_get_usage to obtain the current PHP memory consumption for program performance optimization.
  • Steps for synchronizing and backing up mysql Databases in windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.