ProjectMeshnet/nodeatlas

Using MySQL as a database results in an error when it creates tables

Closed this issue · 2 comments

The error

$ nodeatlas
2013/11/21 20:08:56 INFO Starting NodeAtlas v0.5.12-25-g4733983
2013/11/21 20:08:56 EMERG Could not initialize database: Error 1064: 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 'AUTOINCREMENT,
hostname VARCHAR(255) NOT NULL,
name VARCHAR(255) NOT NULL)' at line 2
$

The issue in this case is that MySQL wants you to use 'AUTO_INCREMENT' instead of 'AUTOINCREMENT'. The reason why it can't just be changed easily in the code itself is that sqlite3 (The default database provider for nodeatlas) apparently does not like 'AUTO_INCREMENT'.

For temporary solutions, you can change the code to the correct MySQL syntax before buildtime

SQL became a standard of the American National Standards Institute (ANSI) in 1986, and of the International Organization for Standards (ISO) in 1987.
[Wikipedia]

lol

Fixed in e0fb6f4