diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-03-17 12:35:54 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-03-17 12:35:54 -0700 |
commit | c4a7c31581c8386198317a2385f9c7d462c18497 (patch) | |
tree | f3c0a6a7d3f0534082ae12f930f86dfcdde05e30 /activerecord/lib/active_record | |
parent | 8744632fb5649cf26cdcd1518a3554ece95a401b (diff) | |
parent | 274e966a6a5db0daf43928041120b29e66eb2c56 (diff) | |
download | rails-c4a7c31581c8386198317a2385f9c7d462c18497.tar.gz rails-c4a7c31581c8386198317a2385f9c7d462c18497.tar.bz2 rails-c4a7c31581c8386198317a2385f9c7d462c18497.zip |
Merge pull request #9762 from senny/8079_do_not_grant_on_root_user
`rake db:create` does not change permissions of root user.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/tasks/mysql_database_tasks.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/tasks/mysql_database_tasks.rb b/activerecord/lib/active_record/tasks/mysql_database_tasks.rb index 10696258c9..50569d2462 100644 --- a/activerecord/lib/active_record/tasks/mysql_database_tasks.rb +++ b/activerecord/lib/active_record/tasks/mysql_database_tasks.rb @@ -26,7 +26,9 @@ module ActiveRecord $stdout.print error.error establish_connection root_configuration_without_database connection.create_database configuration['database'], creation_options - connection.execute grant_statement.gsub(/\s+/, ' ').strip + if configuration['username'] != 'root' + connection.execute grant_statement.gsub(/\s+/, ' ').strip + end establish_connection configuration else $stderr.puts "Couldn't create database for #{configuration.inspect}, #{creation_options.inspect}" |