如何使用 MySQL 工作台更改(更新)表中的列名?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33094174/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 21:19:35  来源:igfitidea点击:

how to change (Update) column name in table using MySQL workbench?

mysqlmysql-workbench

提问by dsl

I am new to MySQL. I created a table with column name First Namebut it is wrong.

我是 MySQL 的新手。我用列名创建了一个表,First Name但它是错误的。

Now I want to change my column name First Nameto First_Name. Is it possible? If yes please explain how I can change my column name.

现在我想将我的列名更改First NameFirst_Name. 是否可以?如果是,请解释我如何更改我的列名。

回答by Kshitij Kulshrestha

You can change it by following these step :

您可以按照以下步骤更改它:

  1. Right click the table shown at the left in Schematab of workbench and then select Alter Table. You will get a window like this -> enter image description here

  2. Here you can see the column names available, edit here and click on apply.

  1. 右键单击Schema工作台选项卡左侧显示的表,然后选择Alter Table。你会得到一个这样的窗口 -> 在此处输入图片说明

  2. 在这里您可以看到可用的列名称,在此处编辑并单击应用。

You are done.

你完成了。