You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/mysql/flexible-server/concepts-server-parameters.md
+88-4Lines changed: 88 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,7 +116,7 @@ Creating new client connections to MySQL takes time and once established, these
116
116
117
117
### innodb_strict_mode
118
118
119
-
If you receive an error similar to "Row size too large (> 8126)", you may want to turn OFF the parameter **innodb_strict_mode**. The server parameter **innodb_strict_mode**isn't allowed to be modified globally at the server level because if row data size is larger than 8k, the data is truncated without an error, which can lead to potential data loss. We recommend modifying the schema to fit the page size limit.
119
+
If you receive an error similar to "Row size too large (> 8126)", you may want to turn OFF the parameter **innodb_strict_mode**. The server parameter **innodb_strict_mode**can't be modified globally at the server level because if row data size is larger than 8k, the data is truncated without an error, which can lead to potential data loss. We recommend modifying the schema to fit the page size limit.
120
120
121
121
This parameter can be set at a session level using `init_connect`. To set **innodb_strict_mode** at session level, refer to [setting parameter not listed](./how-to-configure-server-parameters-portal.md#setting-non-modifiable-server-parameters).
122
122
@@ -131,7 +131,7 @@ Upon initial deployment, an Azure for MySQL Flexible Server includes system tabl
131
131
132
132
In Azure Database for MySQL this parameter specifies the number of seconds the service waits before purging the binary log file.
133
133
134
-
The binary log contains “events” that describe database changes such as table creation operations or changes to table data. It also contains events for statements that potentially could have made changes. The binary log is used mainly for two purposes, replication and data recovery operations. Usually, the binary logs are purged as soon as the handle is free from service, backup or the replica set. If there are multiple replicas, the binary logs wait for the slowest replica to read the changes before it's been purged. If you want to persist binary logs for a more duration of time, you can configure the parameter binlog_expire_logs_seconds. If the binlog_expire_logs_seconds is set to 0, which is the default value, it purges as soon as the handle to the binary log is freed. If binlog_expire_logs_seconds > 0, then it would wait until the seconds configured before it purges. For Azure database for MySQL, managed features like backup and read replica purging of binary files are handled internally. When you replicate the data-out from the Azure Database for MySQL service, this parameter needs to be set in primary to avoid purging of binary logs before the replica reads from the changes from the primary. If you set the binlog_expire_logs_seconds to a higher value, then the binary logs won't get purged soon enough and can lead to increase in the storage billing.
134
+
The binary log contains “events” that describe database changes such as table creation operations or changes to table data. It also contains events for statements that potentially could have made changes. The binary log is used mainly for two purposes, replication and data recovery operations. Usually, the binary logs are purged as soon as the handle is free from service, backup or the replica set. If there are multiple replicas, the binary logs wait for the slowest replica to read the changes before it's been purged. If you want to persist binary logs for a more duration of time, you can configure the parameter binlog_expire_logs_seconds. If the binlog_expire_logs_seconds is set to 0, which is the default value, it purges as soon as the handle to the binary log is freed. If binlog_expire_logs_seconds > 0, then it would wait until the seconds configured before it purges. For Azure database for MySQL, managed features like backup and read replica purging of binary files are handled internally. When you replicate the data-out from the Azure Database for MySQL service, this parameter needs to be set in primary to avoid purging of binary logs before the replica reads from the changes from the primary. If you set the binlog_expire_logs_seconds to a higher value, then the binary logs won't be purged soon enough and can lead to increase in the storage billing.
135
135
136
136
### event_scheduler
137
137
@@ -193,15 +193,99 @@ To configure the `event_scheduler` server parameter in Azure Database for MySQL,
193
193
194
194
4. To view the Event Scheduler Details, run the following SQL statement:
| Db | Name | Definer | Time zone | Type | Execute at | Interval value | Interval field | Starts | Ends | Status | Originator | character_set_client | collation_connection | Database Collation |
5. After few minutes, query the rows from the table to begin viewing the rows inserted every minute as per the `event_scheduler` parameter you configured:
213
+
214
+
```azurecli
215
+
mysql> select * from tab1;
216
+
+----+---------------------+-------------+
217
+
| id | CreatedAt | CreatedBy |
218
+
+----+---------------------+-------------+
219
+
| 1 | 2023-04-05 14:47:04 | azureuser@% |
220
+
| 2 | 2023-04-05 14:48:04 | azureuser@% |
221
+
| 3 | 2023-04-05 14:49:04 | azureuser@% |
222
+
| 4 | 2023-04-05 14:50:04 | azureuser@% |
223
+
+----+---------------------+-------------+
224
+
4 rows in set (0.23 sec)
225
+
```
226
+
227
+
6. After an hour, run a Select statement on the table to view the complete result of the values inserted into table every minute for an hour as the `event_scheduler` is configured in our case.
228
+
229
+
```azurecli
230
+
mysql> select * from tab1;
231
+
+----+---------------------+-------------+
232
+
| id | CreatedAt | CreatedBy |
233
+
+----+---------------------+-------------+
234
+
| 1 | 2023-04-05 14:47:04 | azureuser@% |
235
+
| 2 | 2023-04-05 14:48:04 | azureuser@% |
236
+
| 3 | 2023-04-05 14:49:04 | azureuser@% |
237
+
| 4 | 2023-04-05 14:50:04 | azureuser@% |
238
+
| 5 | 2023-04-05 14:51:04 | azureuser@% |
239
+
| 6 | 2023-04-05 14:52:04 | azureuser@% |
240
+
..< 50 lines trimmed to compact output >..
241
+
| 56 | 2023-04-05 15:42:04 | azureuser@% |
242
+
| 57 | 2023-04-05 15:43:04 | azureuser@% |
243
+
| 58 | 2023-04-05 15:44:04 | azureuser@% |
244
+
| 59 | 2023-04-05 15:45:04 | azureuser@% |
245
+
| 60 | 2023-04-05 15:46:04 | azureuser@% |
246
+
| 61 | 2023-04-05 15:47:04 | azureuser@% |
247
+
+----+---------------------+-------------+
248
+
61 rows in set (0.23 sec)
249
+
```
250
+
251
+
#### Other scenarios
252
+
253
+
You can set up an event based on the requirements of your specific scenario. A few similar examples of scheduling SQL statements to run at different time intervals follow.
254
+
255
+
**Run a SQL statement now and repeat one time per day with no end**
256
+
257
+
```sql
258
+
CREATE EVENT <event name>
259
+
ON SCHEDULE
260
+
EVERY 1 DAY
261
+
STARTS (TIMESTAMP(CURRENT_DATE) + INTERVAL 1 DAY + INTERVAL 1 HOUR)
0 commit comments