First, to avoid opening the network of the container to another network, you need to open a shell to the docker container itself. To do so, use the following command:
1
docker exec-it website_db /bin/bash;
After executing the exec command, you will get a shell to the docker container. Use the following command to optimize all databases and their tables:
1
mysqlcheck -p -o --all-databases;
The -p parameter instructs the command to ask for a password (which probably and hopefully have set).
To exit the console and close the connection just type exit; after you are done with the above command.
Note: Where we used the word website_db you need to use the name of your container. If you are not sure of the name of the container, you can list all of the containers with their names using the following command:
A) Create a firewall rule in your VPC Network that allows you to connect to your database from outside the network: https://console.cloud.google.com/networking/firewalls/list B) From your remote machine repair your database using mysqlcheck. On Fedora you can install it by installing the MariaDB package as follows: sudo dnf install mariadb -y;…
2022-06-07 7:17:02 3051 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'hist_type' at position 9 to have type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB'), found type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB'). 2022-06-07 7:17:02 3051 [ERROR] Incorrect definition of table mysql.column_stats: expected column 'histogram' at position 10 to have type longblob, found type varbinary(255). While checking the logs of a…
IP allocations First, we set up a static IP on the network device that would handle all external traffic and a DHCP on the network device that would access the management network, which is connected for maintenance. To do so, we created the following file: /etc/netplan/01-netcfg.yaml using the following command:…