Connect to a #MySQL database from #Javascript with MySqlJS.com
If you’ve ever needed to develop something in a hurry, and you find yourself writing more middleware than business logic or the website itself, then this is going to be a real time-saver.
MySqlJS.com cuts out the middle tier of a website by communicating directly from the Javascript to the MySql database, using a statement such as
MySql.Execute( "mysql.yourhost.com", "username", "password", "database", "select * from Users", function (data) { console.log(data) });
But then, I see that you’re screaming at me!, this isn’t secure, everyone can see my database password!, but the point of this code is, that it’s not for scenarios where the source code is accessible to the public. So, it’s fine for Phonegap / Cordova / WinJS apps where the end user can’t access the source code. Or perhaps, if it’s a password-protected private website where only trusted employees are going to access it. – Or, it’s just a quick mock up for a demo, or school project.
If you want to play with it, and need a test database to play with, then you can use this:
Host: sql8.freemysqlhosting.net
Database name: sql8110237
Database user: sql8110237
Database password: Gn1uMM2Adr