Home  >  Article  >  Database  >  How to modify the primary key in phpmyadmin

How to modify the primary key in phpmyadmin

藏色散人
藏色散人Original
2019-10-19 09:05:384112browse

How to modify the primary key in phpmyadmin

How to modify the primary key in phpmyadmin?

phpmyadmin sets the primary key, phpMyAdmin primary key is added

Open the phpMyAdmin application software, enter the database name and login password on the login page, and then click Execute, as shown in the figure below.

Recommendation: "mysql tutorial"

How to modify the primary key in phpmyadmin

##After successfully logging in to phpMyAdmin, click Database on the navigation on the left. As shown below.

How to modify the primary key in phpmyadmin

In the phpMyAdmin database, we click to create a new database table, as shown in the figure below.

How to modify the primary key in phpmyadmin

After opening the phpMyAdmin new database table page, click the drop-down menu in the "Index" of the new table column on the right to select primary. Selecting primary means that the primary key of the table has been set. , and then click Execute, as shown in the figure below.

How to modify the primary key in phpmyadmin

Add and set the primary key to the built phpMyAdmin table

Find the table to which you want to add the primary key in the database corresponding to phpMyAdmin. Then click on the corresponding "Structure" behind the table, as shown in the figure below.

How to modify the primary key in phpmyadmin

After opening the phpMyAdmin database table structure, we can see the primary key corresponding to the database table. We click on the primary key to add and set the primary key to the phpMyAdmin table, as shown in the figure below .

How to modify the primary key in phpmyadmin

OK, phpMyAdmin prompts that the table primary key has been set successfully. At this time, you can see that the key at the primary key changes color, as shown in the figure below.

How to modify the primary key in phpmyadmin

Code to add and set the primary key of the phpMyAdmin table

I see clicking to open the SQL tab on the phpMyAdmin software, and then in the input box Enter the code to set the primary key of phpMyAdmin, and then click Execute. As shown below.

How to modify the primary key in phpmyadmin

The above is the detailed content of How to modify the primary key in phpmyadmin. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn