aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/commands/dbconsole.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/commands/dbconsole.rb')
-rw-r--r--railties/lib/commands/dbconsole.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/commands/dbconsole.rb b/railties/lib/commands/dbconsole.rb
index 17acb7b68f..5be3b5dd8e 100644
--- a/railties/lib/commands/dbconsole.rb
+++ b/railties/lib/commands/dbconsole.rb
@@ -41,11 +41,13 @@ when "mysql"
if config['password'] && include_password
args << "--password=#{config['password']}"
+ elsif config['password'] && !config['password'].empty?
+ args << "-p"
end
args << config['database']
- exec(find_cmd('mysql5', 'mysql'), *args)
+ exec(find_cmd('mysql', 'mysql5'), *args)
when "postgresql"
ENV['PGUSER'] = config["username"] if config["username"]