Reputation: 31
I have a problem using the heroku db:push command to transfer a MySQL database to heroku. I've tried using the same command for another app with a sqlite3 database and everything went fine.
C:\Users\reg\Team-Omni>heroku db:push
Loaded Taps v0.3.9 Auto-detected local database: mysql://127.0.0.1/omni_dev?encoding=utf8 Warning: Data in the app 'growing-mist-42' will be overwritten and will not be recoverable . Are you sure you wish to continue? (y/n)? y
Failed to connect to database:
Sequel::DatabaseConnectionError -> Mysql::Error: Access denied for user 'reg'@'localhost ' (using password: NO)
if i remove the password for the mysql anonymous account, the error changes to
Sequel::DatabaseConnectionError -> Mysql::Error: Access denied for user ''@'localhost' to database 'omni_dev'
--additional information--
my .gems file:
rails -v 2.3.8
andre-geokit --version 1.5.0 --source http://gems.github.com
Upvotes: 3
Views: 2368
Reputation: 581
I've had this problem as well, but I was passing a password. My local app worked fine, but when using heroku db:push
, I got the same error as redge.
Adding a port in the database.yml fixed the problem. So, a working database.yml has the following entries:
database: DATABASE
username: USER
password: PASSWORD
adapter: mysql
encoding: utf8
socket: /Applications/MAMP/tmp/mysql/mysql.sock
port: 8889
Upvotes: 1
Reputation: 12139
You are getting that error because you are not specifying the password for the local database connection. Apparently the username is configured as 'reg' (maybe in the MySQL config file). This doesn't have anything to do with the Heroku PostgreSQL database, it's a problem connecting to your local MySQL database (named omni_dev).
Try the following connection string:
mysql://USERNAME:[email protected]/omni_dev?encoding=utf8
for the appropriate values of USERNAME and PASSWORD.
Upvotes: 4