Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Add instructions to run the example when get the error `Unhandled exception: Client does not support authentication protocol requested by server; consider upgrading MySQL client (Exception)`

Closes crystal-lang#56
  • Loading branch information
fernandes authored Mar 2, 2019
1 parent 9a838e3 commit 3359741
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,23 @@ DB.open "mysql://root@localhost/test" do |db|
end
end
end
```
```

When running this example, if you get the following exception:

> Unhandled exception: Client does not support authentication protocol requested by server; consider upgrading MySQL client (Exception)
You have two options, set a password for root, or (most recommended option) create another user with access to `test` database.

```mysql
CREATE USER 'test'@'localhost' IDENTIFIED WITH mysql_native_password BY 'yourpassword';
GRANT ALL PRIVILEGES ON test.* TO 'test'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit
```

Then use the example above changing the DB.open line to

```crystal
DB.open "mysql://test:yourpassword@localhost/test" do |db|
```

0 comments on commit 3359741

Please sign in to comment.