Change column name in MariaDB

I have this column in this database with space included, which I want to change.

ALTER TABLE . CHANGE COLUMN `Anzahl Personen` AnzahlPersonen int(11); 

After using this line on the command line, the output is as follows:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHANGE COLUMN `Anzahl Personen` AnzahlPersonen int(11)' at line 1

Yes, I have no idea what I'm doing wrong.

+4
source share
2 answers

If a period (.) Is used instead of the table name, then you have an error. You must specify a table name:

ALTER TABLE `table_name` CHANGE COLUMN `Anzahl Personen` AnzahlPersonen int(11);
+8
source

ALTER TABLE <table_name> CHANGE COLUMN old_name new_name column_definition

https://jira.mariadb.org/browse/MDEV-16290

0
source

All Articles