Config 1.3: Database Access

To access database, you assign an array to Db in config.json:

Db              example:["mysql", "dbuser:dbpass@/dbname"]

Note that the array format depends on which server-side programming language and which database package you are using.

The above example is for accessing MySQL database dbname using account dbuser with password dbpass in GO.

To access the same database in Perl, you may need to use

 "Db": ["DBI:mysql:dbname", "dbuser", "dbpass"]

If you run the help command, the database array will be set up for you automatically.

Comments are closed.