Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysqlHasDefault() broken on Linux? #206

Closed
beanumber opened this issue Jun 21, 2017 · 1 comment
Closed

mysqlHasDefault() broken on Linux? #206

beanumber opened this issue Jun 21, 2017 · 1 comment

Comments

@beanumber
Copy link

Note that:

> RMySQL::mysqlHasDefault()
Could not initialise default MySQL database. If MySQL is running
check that you have a ~/.my.cnf file that contains a [rs-dbi] section
describing how to connect to a test database.
[1] FALSE

However, the problem seems to be the 127.0.0.1 vs. localhost issue raised here.

> DBI::dbConnect(RMySQL::MySQL(), dbname = "test", host = "127.0.0.1")
<MySQLConnection:0,6>
> DBI::dbConnect(RMySQL::MySQL(), dbname = "test")
Error in .local(drv, ...) : 
  Failed to connect to database: Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
@beanumber
Copy link
Author

Fixed by adding host=127.0.0.1 to my defaults file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant