I am new to MySQL. I created a table with column name First Name
but it is wrong.
Now I want to change my column name First Name
to First_Name
. Is it possible? If yes please explain how I can change my column name.
To change a column name, enter the following statement in your MySQL shell: ALTER TABLE table_name RENAME COLUMN old_column_name TO new_column_name; Replace table_name , old_column_name , and new_column_name with your table and column names.
To rename a column in MySQL the following syntax is used: ALTER TABLE table_name RENAME COLUMN old_column_name TO new_column_name; This command is used to change the name of a column to a new column name.
To change the name, data type, default value, or comment of a column, double-click the value to edit it. You can also add column comments to the Column Comment field. It is also possible to set the column collation, using the list in the Column Details panel.
You can change it by following these step :
Right click the table shown at the left in Schema
tab of workbench and then select Alter Table
. You will get a window like this ->
Here you can see the column names available, edit here and click on apply.
You are done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With