Skip to content

Commit

Permalink
Set AllowNativePasswords to true to get tests working again (petoju#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Stump authored Oct 23, 2018
1 parent 5317b21 commit 81ef351
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/terraform-providers/terraform-provider-mysql.svg?branch=master)](https://travis-ci.org/terraform-providers/terraform-provider-mysql)

Terraform Provider
==================

Expand Down
16 changes: 7 additions & 9 deletions mysql/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
}

conf := mysql.Config{
User: d.Get("username").(string),
Passwd: d.Get("password").(string),
Net: proto,
Addr: endpoint,
TLSConfig: d.Get("tls").(string),
User: d.Get("username").(string),
Passwd: d.Get("password").(string),
Net: proto,
Addr: endpoint,
TLSConfig: d.Get("tls").(string),
AllowNativePasswords: true,
}

return &MySQLConfiguration{
Expand Down Expand Up @@ -124,10 +125,7 @@ func connectToMySQL(conf *mysql.Config) (*sql.DB, error) {
return resource.RetryableError(err)
}

// The Go SDK for MySQL doesn't actually connect until a query is ran.
// This forces a simple query to run, which runs a connect, which lets
// the retry logic do its thing.
_, err = serverVersion(db)
err = db.Ping()
if err != nil {
return resource.RetryableError(err)
}
Expand Down
2 changes: 1 addition & 1 deletion mysql/resource_grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func DeleteGrant(d *schema.ResourceData, meta interface{}) error {
if err != nil {
return err
}

database := formatDatabaseName(d.Get("database").(string))

stmtSQL := fmt.Sprintf("REVOKE GRANT OPTION ON %s.%s FROM '%s'@'%s'",
Expand Down

0 comments on commit 81ef351

Please sign in to comment.