Fix Error Connect Container Mysql Lastest in Docker
HTML-код
- Опубликовано: 9 сен 2024
- Fix lỗi kết nối đến container mysql cho các phiên bản sau 5.7.
Fix connection error to mysql container for versions after 5.7
Tổng hợp cách fix lỗi trên
-- Connect to the MySQL server
mysql -u root -p
-- Create a new user with the necessary privileges
CREATE USER 'new_user'@'172.18.0.2' IDENTIFIED BY 'new_password';
-- Grant the required privileges to the new user for the specified host
GRANT ALL PRIVILEGES ON . TO 'new_user'@'172.18.0.2' WITH GRANT OPTION;
-- Flush the privileges to apply the changes
FLUSH PRIVILEGES;