how to communicate between nodejs and DB - mysql

I want to know how to communicate between nodejs and database.
I found the similar question and tried with 'db-mysql module;
but it doesn't work at window.
it has a problem with install and I found that the problem will never get fixed.
the problem is node-waf, and i found it'll never support at window.
Then how can I communicate with Database, with js file?
If JS file Using Node.js, isn't it only works in the directory that nodejs is installed? And Isn't it only be a JS file?
How can i using the database and db query... such as mysql query.... and how to connect?? Plz help ME..

First of all, I'm not developing with node.js in Windows so I haven't tested myself any of the answers provided below.
There seem to be more than one module to query mysql from node.js, check this link:
https://stackoverflow.com/a/8889152/1366519
Also, https://github.com/mariano/node-db-mysql/ seems to work in cygwin per this answer:
https://stackoverflow.com/a/7025137/1366519

Related

how can we connect MYSQL with html

i want to connect my data base with html web side please tell me how can i connect the html website to MY SQL.
You need to use PHP and setup a Localhost webserver, something like Wamp or Xamp will do.
I personally use Wamp, you can make a Database in the PhpMyAdmin service provided with it.
To further setup and connect to your database, you can simply search on google for some more detailed steps regarding to database connections.
but using a local webserver and php should get you up and running.
You need to use backend script/service to achieve the goal. You cant make connection directly. In between database and frontend (your html pages) there is backend.
to achieve your goal you can use php, node js which has n number of tutorials available.
Your question is getting minus points because it is incomplete and very basic.
Thanks

I can't enter to "localhost:8080/phpmyadmin"

Im trying to enter and it says This site can't be reached: connection refused... also, I made sure that the settings are right on the html files of the modules I am currently using which are apache and mysql. I've read through the web and someone said that I had to stop the apache module or mysql module, already did it, but no luck... any help with this problem?
As far as I know, you are no need to use the port number.
localhost/phpmyadmin
I hope this will work. If you are using a Linux version. please check this thread.
I had similar problem using easyphp with php, mysql and apache and solved it by running as administrator
What are you using as your local server? Have you restarted the services? Does it say your localhost is running properly?

Connecting to HBase using Rest Services

I followed the tutorial and tried communicating to HBase using JSON and Rest Services.
I am using the cloudera distribution CDH4.6
The HBase version in this is hbase-0.94.15+86
I called the following link(60000 is the port where HBase is running on the CDH4 VMware Machine. location is the name of the table)
http://192.168.26.128:60000/location (using get)
This is mentioned in the following link, that this should get all the table data in JSON format
http://wiki.apache.org/hadoop/Hbase/JSONRest
I got the following error:
org.apache.hadoop.ipc.RPC$VersionMismatch>Server IPC version 3 cannot communicate with
client version 47
I am not able to understand where the mismatch is happening? Am I doing something( or might be everything) wrong? Please point me in the correct direction
Also, is the REST Service, already installed on the CDH or do we have to install it? An elaborate answer on the basics or any link to a document explaining the very basic step by step would be very much helpful.
I have been trying to google and found a lot of stuffs, but nothing was able to make things work for me.
Thanks in advance

Trying to get a local MySQL database to work with GAE development server

Soo, I've decided to toy around a bit with GAE. Most of my previous experience with developing web-applications is with ASP.Net, so this java / eclipse-world is kinda unfamiliar to me.
I read around, and found out that I can configure my project to use a Google Cloud SQL instance when it's deployed at Google, while using a local MySQL database while running locally on my development server.
The problem I ran in to now is that I can simply not press "Ok" in the eclipse dialog for configuring my local MySQL database? Well - I can, but with no result. No error message, no window close, no nothing.
I'm not really sure what I am doing wrong, but was hoping some wiz in here who has more experience than me with GAE have had a similar problem and a solution?
I've attached a picture of my local MySQL configuration:
http://imgur.com/0tjK7Sf
Thanks in advance

How can I deploy an SQL database to AppHarbor from GitHub?

I've got appharbor working currently with github, but the problem I'm running into is scripting my database schema (and test data) and having it deployed along with the rest of my project.
Have any of you done this before? How might I achieve this?
AppHarbor is already stripping out my dev connection string and replacing it with their own, but I'm not sure how to get my SQL DB to deploy automagically.
At AppHarbor, we use NHibernate SchemaUpdate. You can see it in action on this PostgreSQL-compatible sample and it should work just as well with SQL Server. The trick is to do it in Application_Start (and not during a build, which may fail).
If you're using Entity Framework, you should be able to achieve the same effect with the new Migrations feature.
Have a look at Manatee by Rob Conery:
https://github.com/robconery/manatee
This handles db migrations.