patrickjquinn / P-Brain.ai

Natural language virtual assistant using Node.js + Bootstrap
MIT License
340 stars 75 forks source link

Need Help To Change Database Sqlite3 to Mysql #107

Closed alexia-rose closed 3 years ago

alexia-rose commented 3 years ago

I am new on web apps and coding currently learning Mysql and nodejs, I really like this AI, but it seems working with sqlite3 but I wanna change it to MySQL and remove that sqlite3 (it was too much annoying to install also) can anyone give me ideas how can I do it, as a beginner the code seems too much professional to me?

timstableford commented 3 years ago

Could you elaborate on how SQLite was hard to install please? It should just work running an npm install command with no external dependencies.

To use MySQL create a config.json in the projects root that looks something like this:

{
  "databaseType": "mysql",
  "databaseArguments": {
    "host": "127.0.0.1",
    "username": "root",
    "password": "example",
    "database": "pbrain"
  }
}

https://github.com/patrickjquinn/P-Brain.ai/blob/master/db/index.js

alexia-rose commented 3 years ago

thanks for response I save config.json on the root folder and created a DB on MySQL but still, it's running over sqlite3 Capture1 Capture

and I encountered a random error on installing SQLite after that I find a solution from StackOverflow, that I had to uninstall SQLite then have to clear cache, and installed it again....

SiyamF commented 3 years ago

Save the config.json file on "db" folder

alexia-rose commented 3 years ago

Thanks, @SiyamF its solve the problem