How To Rename A Field

Table of contents:

How To Rename A Field
How To Rename A Field

Video: How To Rename A Field

Video: How To Rename A Field
Video: Rename field in attribute table ArcGIS 2024, May
Anonim

Database tables that store information actually have little to do with the columns, rows and cells we are used to. However, to simplify terminology, the column heading of a conditional table can be considered the name of a field in a real table in the database. The task of renaming such a column when using the most commonly used MySQL DBMS in web programming is easiest to solve using the PhpMyAdmin application.

How to rename a field
How to rename a field

Instructions

Step 1

Download the phpMyAdmin control panel to your browser - the corresponding link can be found in your hosting company's control panel. The left frame of this panel contains a list of databases available to you - select the one in which the required table is located, and the list of tables of the selected database will be loaded into this frame.

Step 2

Click the link for the table whose field you want to rename. In the right frame, the program will open a page, which will contain a table containing information about the fields. In the column with the heading "Field", find the name that you want to change, and put a mark in the checkbox of this line. Then click the pencil icon - it is placed under the table, in the line with the labeled "Marked" and when you hover over it, the text "Edit" will pop up.

Step 3

Change the name next to the "Field" caption in the next page loaded into the right frame as needed. Here you can also specify other changes for this field - change the encoding, select a different data type, set the default value, etc. Then click the "Save" button located to the right and below the table of parameters of the field to be changed. PhpMyAdmin will form and send the required request to the SQL server, and after receiving the response, it will show you a message about the results of the operation.

Step 4

You can not use the interactive renaming mode, but enter the required SQL query yourself. To do this, click the "SQL" link at the top of the right frame and type the query text in the text field of the form that opens. It may look like this: ALTER TABLE `tableName` CHANGE` oldName` `newName` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL Here tableName is the name of the table, oldName is the name of the field before renaming, and newName is after. After entering the request, click the "OK" button, and the program will proceed with the request in the same way as in the previous step - it will send it to the server and present information about the execution results.

Recommended: