Access denied for user 'root'@'localhost' (using password: YES)
I setup a new environment where mysql does not have a password and how I am getting this error. Where do I change
'root'@'localhost' (using password: YES)
my database.yml is show below my database is sample_app
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: mysql2
database: db/development.mysql2
pool: 5
timeout: 5000
database: sample_app
username: root
socket: /tmp/mysql.sock
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
database: db/test.mysql2
pool: 5
timeout: 5000
database: sample_app
username: root
socket: /tmp/mysql.sock
production:
adapter: mysql2
database: db/production.mysql2
pool: 5
timeout: 5000
database: sample_app
username: root
socket: /var/run/mysqld/mysqld.sock
You should not be using root to connect to a db with an app. Create a new user/password with a name to recognize that it is being used for a specific app\task then use that instead of root.
add this for empty password
password:If you still get access denied, then the db is saying that the user\password is not valid