-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem while running the example js files #2
Comments
That's a MySQL error, did you set up your config.js file like the example in the README.me? |
I did set it up according to the readme file. But I think may be my credentials are wrong. So fixing the MySQL should fix my problem. Thank you for your quick response. I will update the issue after I successfully get past my error. |
Yeah that could definitely be you issue if the MySQL credentials are incorrect. |
Were you able to resolve this issue? |
After commenting the line:
I was able to get the result of 'get_cheapest_flight.js'. But I still do not have the MySQL table created. When I run the 'database_flight_tracking.js' I get the following error: 2016-04-19T19:03:59-07:00 { Do you know what configuration of MySQL is not set correctly? Am I supposed to create the database or will it be created programatically? |
In the config file I have provided the root credentials for MySql. Is that right? |
Anyway I am able to get the JSON data. That's all I wanted for the time being. Thank you so much for your response. |
Having to comment out the line that requires request means that you don't have it installed, which I looked in the package.json file and I realized I forgot to include that in there because I never actually used it in the code except for that line with the require. I'll update that and push the new changes back to the repo. As for the mysql database ER_BAD_DB_ERROR means that the database that it is looking for is missing. The mysql database and tables aren't created automatically, you need to run the create_tables.sql file in mysql and that will create the correct database and tables for you. |
I had tried using npm install request but that too didn't help. It is only after that I resorted to comment out that line. I totally missed the SQL folder. I was able to run the script and get the tables as described. Then I executed node examples\database_flight_tracking.js and it is in a never-ending loop sort of a situation where the node command line is not getting back to prompt. Neither are the database tables getting updated. |
Got the following logs after sometime: 2016-04-20T17:48:22-07:00 No row in the db for the current flight, don't check price for email 2016-04-20T17:48:23-07:00 { 2016-04-20T17:53:22-07:00 No row in the db for the current flight, don't check price for email 2016-04-20T17:53:22-07:00 { |
Can I delete the config.Email section? I want only in the database. |
[Note: I have not used forever.js for continuous running of the Node script.] |
The problem is that it is not entering anything into the database. That's why that error is returned when the query results in 0 rows. |
Thank you for your support. I found that the following problems were there: In the SQL script we must use the 'USE' statement wherever applicable and check for existence of the db before deleting and drop operations. The date time value passed in the SQL query has a problem with the Datetime format for the departure_date column. '2016-04-21T20:05:00-04:00' is not accepted. '2016-04-21 20:05:00' is accepted. I am closing this issue as I was able to get the required data into MySql. I will create a Pull request with the changes for SQL and index.js. You can check and merge if found to be useful. Once again thank you for the support. |
Running the test 'database_flight_tracking.js' from the examples I am getting the following error:
"2016-04-10T17:08:18-07:00 {
"code": "ECONNREFUSED",
"errno": "ECONNREFUSED",
"syscall": "connect",
"address": "195.162.20.5",
"port": 4398,
"fatal": true
}"
After this running the 'get_cheapest_flight.js' gives the error 'Cannot find the module 'flights'
'
The text was updated successfully, but these errors were encountered: