Modifying the my.cnf Configuration File of a Specified MySQL Pod
This section uses the mysql-1 configuration file as an example to describe how to modify the configuration file.
- Method 1: Run the following command on the K8s primary node to access the mysql-1 pod:
kubectl exec -it mysql-1 -n ns-mysql-test -- /bin/bash
Run the following command in the pod:
vi /etc/my.cnf
- Method 2: Run the following command on the K8s primary node to open the configuration file on the target pod:
1kubectl exec -it mysql-1 -n ns-mysql-test -- vi /etc/my.cnf
If you use the MobaXterm tool to run the preceding command, the file content may be displayed improperly. You are advised to use PowerShell provided by the Windows operating system.
- Method 3: Modify the mysql_arm.cnf file on the physical machine where the mysql-1 pod is located.
1vi /data/mysql/mysql_1/mysql_arm.cnf
Parent topic: K8s MGR Maintenance