Keep update MySQL error collection

This is an article about how to solve the error i meet in using MySQL

1
2
ERROR 1064 (42000) at line 22: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'json DEFAULT NULL,
`avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NU' at line 9

About this error, you can change your database character

1
2
3
4
5
6
7
8
9
10
mysql> show processlist;
+----+----------------------+------------------+------+---------+------+----------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+----------------------+------------------+------+---------+------+----------+------------------+
| 4 | root | 172.17.0.1:55022 | NULL | Query | 0 | starting | show processlist |
| 15 | unauthenticated user | 172.17.0.1:55324 | NULL | Connect | 16 | login | NULL |
| 16 | unauthenticated user | 172.17.0.1:55342 | NULL | Connect | 6 | login | NULL |
| 17 | unauthenticated user | 172.17.0.1:55340 | NULL | Connect | 6 | login | NULL |
+----+----------------------+------------------+------+---------+------+----------+------------------+
4 rows in set (0.00 sec)

I have run a mysql docker container for a symfony website.
But all of the pages open are very slow, even if loading a blank page.
So i check the blank page speed before mysql start and after mysql stop.
I found that every time there are these database connection during the page loading.
About this error ,you can add following code to solve it.

1
2
[mysqld]
skip-name-resolve

This prevents MySQL trying to resolve the host name for each thread, bypassing the name server problem.

Share