mysql - is it possible to update the information_schema table in order to add leading text to column names? -


i trying execute sql root:

update information_schema.columns set column_name = concat('emp',column_name)  table_schema = 'edsdb' 

but following error:

sql error [1044] [42000]: access denied user 'root'@'localhost' database 'information_schema' com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception: access denied user 'root'@'localhost' database 'information_schema' 

these tables need 'fix' column names off have lot of columns in them. possible directly in sql?

as per mysql documentation (here), information_schema contains read-only tables views can't change it:

the information_schema database contains several read-only tables. views, not base tables, there no files associated them, , cannot set triggers on them. also, there no database directory name.

you need use alter table command instead, e.g.:

alter table `edsdb` change `id` `empid` int; 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -