Title: Dont change value of column - MySQL
Tags: mysql;sql
Question: I'm trying change the name of a column of my table, but it dont change the name, i have tried this command:
ALTER TABLE book_loan RENAME COLUMN idbook-loan TO idbook_loan;
Comment: Does this answer your question? [Rename a column in MySQL](https://stackoverflow.com/questions/30290880/rename-a-column-in-mysql)

Comment: it dont works @DaMaGeX

Here is the accepted answer: Do you need backticks around the column name with hyphens in it?
Also, you must repeat the data type of the column. Let's say it is INT ( you didn't mention it so that's a guess.
You want this.
ALTER TABLE book_loan RENAME COLUMN `idbook-loan` TO idbook_loan INT;
It's possible MySql doesn't recognize that hyphen-containing name as a schema object name without the backtick delimiters.


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:09/19/21', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<mysql><sql>', 'Title': 'Dont change value of column - MySQL', 'ViewCount': 48, 'id': 69239513, 'user_AboutMe': '', 'user_AccountId': 22054576.0, 'user_DisplayName': 'Jose Erasmo Hernandez Yate', 'user_Reputation': 11.0, 'user_Views': 6.0, 'user_id': 16318329.0}}