Correggi MySQL ERROR 1064 (42000) controlla il manuale che corrisponde alla versione del tuo server MySQL per la sintassi corretta da utilizzare vicino a ')'
Questo errore può verificarsi se hai utilizzato una sintassi errata. Diciamo che quanto segue è l'istruzione create table:
mysql> create table DemoTable1492
-> (
-> timestamp TIMESTAMP,
-> event int,
-> );
ERROR 1064 (42000): 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 ')' at line 5
Per risolvere il problema è necessario rimuovere la virgola extra sopra dopo la colonna dell'evento. Creiamo innanzitutto un:
mysql> create table DemoTable1492
-> (
-> timestamp TIMESTAMP,
-> event int
-> );
Query OK, 0 rows affected (0.44 sec)
Inserisci alcuni record nella tabella usando insert :
mysql> insert into DemoTable1492 values(now(),101);
Query OK, 1 row affected (0.09 sec)
mysql> insert into DemoTable1492 values(now()+interval 3 month,102);
Query OK, 1 row affected (0.14 sec)
Visualizza tutti i record dalla tabella utilizzando il comando select:
mysql> select * from DemoTable1492;
Ciò produrrà il seguente output:
+---------------------+-------+
| timestamp | event |
+---------------------+-------+
| 2019-10-06 10:56:53 | 101 |
| 2020-01-06 10:57:07 | 102 |
+---------------------+-------+
2 rows in set (0.00 sec)