Closed janis-rullis closed 3 years ago
Pulling ruu-mysql (mariadb:latest)...
ERROR: Head "https://registry-1.docker.io/v2/library/mariadb/manifests/latest": dial tcp: lookup registry-1.docker.io: No address associated with hostname
image: 'mariadb:10.6.4-focal'
rm -f bootstrap/cache/config.php
composer clear-cache
composer dumpautoload -o
composer install
php artisan config:clear
php artisan cache:clear
php artisan migrate
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_schema.tables where table_schema = forge and table_name = migrations and table_type = 'BASE TABLE')
3306:3306
The reason could be that this port is taken.
3346:3306
And restart.
ruu-user
on 3346
.ruu-mysql | 2021-08-26 15:58:09 11 [Warning] Aborted connection 11 to db: 'unconnected' user: 'ruu-user' host: '172.60.0.1' (Got an error reading communication packets)
docker exec -it ruu-mysql bash
mysql -u ruu-user -p
Yes, can connect.
SHOW DATABASES;
| Database |
+--------------------+
| information_schema |
| ruu |
| ruu_testing |
+--------------------+
docker ps
Yes, it is open.
Tried MySQL Workbench, now try DBeaver.
The client version was not suitable for the MariaDB v.10. Updated Workbench but it still could not connect.
Changed it but still the same.
apt install mysql-client
mysql -uruu-user -p -h172.60.2.13 -P3346
ERROR 2003 (HY000): Can't connect to MySQL server on '172.60.2.13:3346' (111)
SHOW GRANTS;
GRANT USAGE ON *.* TO `ruu-user`@`%` IDENTIFIED BY PASSWORD '*3604E7FC9548DB75969E986CDE4618975FB14F96'
GRANT ALL PRIVILEGES ON `ruu`.* TO `ruu-user`@`%`
GRANT ALL PRIVILEGES ON `ruu_testing`.* TO `ruu-user`@`%`
No, the password is fine. Tested by connecting with DBeaver.
SHOW TABLES;
''. So no migration table here.
mysql -uruu-user -p -h172.60.2.13 -P3346
Enter password: ERROR 2003 (HY000): Can't connect to MySQL server on '172.60.2.13:3346' (111)
mysql -uruu-user -p -h172.60.2.13 -P3306
SHOW DATABASES;
ruu, ruu_testing.
Connection is tested.
php artisan migrate
SHOW TABLES;
ingredient
migrations
product
Now it works. Nothing was changed expect the PC was rebooted.
Reboot the host computer :D.
See pr1. Otherwise, the init script will fail.