Skip to content

Instantly share code, notes, and snippets.

@xianhuazhou
Created August 29, 2011 05:29
Show Gist options
  • Select an option

  • Save xianhuazhou/1177824 to your computer and use it in GitHub Desktop.

Select an option

Save xianhuazhou/1177824 to your computer and use it in GitHub Desktop.
convert character for redmine tables
#!/usr/bin/env ruby
require 'rubygems'
require 'mysql'
conn = Mysql::connect("localhost", "redmine", "redmine", "redmine")
conn.list_tables.each do |table|
conn.query("ALTER TABLE `#{table}` CONVERT TO CHARACTER SET 'UTF8'")
end
conn.close
puts "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment