Skip to content

Instantly share code, notes, and snippets.

@prggmr
Created August 20, 2014 06:24
Show Gist options
  • Save prggmr/f6ccc28f59595aff3f84 to your computer and use it in GitHub Desktop.
Save prggmr/f6ccc28f59595aff3f84 to your computer and use it in GitHub Desktop.
Update ALL MySQL Columns
SELECT CONCAT( 'ALTER TABLE ', TABLE_SCHEMA,'.',TABLE_NAME , ' MODIFY ', COLUMN_NAME, ' ', DATA_TYPE , '(', CHARACTER_MAXIMUM_LENGTH , ') CHARACTER SET utf8 ;' ) FROM COLUMNS WHERE TABLE_SCHEMA = 'vpd1' AND CHARACTER_SET_NAME != 'utf8';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment