执行下面命令
rake db:migrate
出现错误
ActiveRecord::StatementInvalid: Mysql2::Error: Native table 'performance_schema'.'session_variables' has the wrong structure: SHOW VARIABLES LIKE 'character_set_database'
/Users/guoyoujin/.rvm/gems/ruby-2.2.5/gems/rack-mini-profiler-0.10.1/lib/patches/db/mysql2.rb:20:in `query'
/Users/guoyoujin/.rvm/gems/ruby-2.2.5/gems/rack-mini-profiler-0.10.1/lib/patches/db/mysql2.rb:20:in `query'
/Users/guoyoujin/.rvm/gems/ruby-2.2.5/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in `block in execute'
版本
$ gem list
mysql2 (0.4.5, 0.3.18)
$ mysql --version
mysql Ver 14.14 Distrib 5.7.16, for osx10.11 (x86_64) using EditLine wrapper
ruby 2.2.5
解决办法
$ mysql_upgrade -u root -p --force
$ mysql.server restart
注意必须重启mysql才能生效哦