AFAIK there aren't any libraries that allow javascript to connect to a MySQL database directly. Instead consider exposing your data via a web service (using any number of server side technologies: ASP.Net, PHP, Ruby on Rails etc) and serialise your data to JSON in the response