Inside PHP container: unable to connect to MySQL 8+
- Dominant language
- PHP
- Stars
- 4.5k
- Forks
- 652
- PR merge metrics
- No merged PRs in 30d
Description
### Have you already checked elsewhere?
- [X] I have read the [Devilbox documentation](https://devilbox.readthedocs.io/en/latest/)
- [X] I have checked the [Devilbox Troubleshooting Guide](https://devilbox.readthedocs.io/en/latest/)
- [X] I have checked the [Devilbox FAQ](https://devilbox.readthedocs.io/en/latest/support/faq.html)
- [X] I have checked the [Devilbox Howto](https://devilbox.readthedocs.io/en/latest/support/howto.html)
- [X] I have checked the [Devilbox Forum](https://devilbox.discourse.group/)
- [X] I have checked [existing issues](https://github.com/cytopia/devilbox/issues)
- [X] I have googled already with no luck
- [ ] I have not done any of the above
### What are you struggling with?
Usually, with MySQL version 5.7 and below, `mysql -h MySQL -u root -p` connects with no problem. With MySQL 8+, this doesn't work anymore. I thought it was the MySQL client version of PHP 7.4, so I switched to 8.0 for a test, but it had the same result. Creating a custom config file would solve this problem, but it should be optional if the image already accepts a password on creation.
Am I missing anything?
Error
```
ERROR 1045 (28000): Plugin caching_sha2_password could not be loaded: /usr/lib/x86_64-linux-gnu/libmariadb3/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
```
### What have you tried already?
Switched PHP versions in hope the mysql client would work.
### What is your goal?
Import a database into mysql 8.0+
Contributor guide
Research direction
No source file or test is identified in the issue. Start by reproducing the MySQL 8+ connection attempt from inside the PHP container and inspect the container's client and authentication configuration; done means importing a database into MySQL 8+ succeeds without requiring an undocumented custom configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, mysql, php
- Domain
- databases, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100