Browsers do not have built-in mechanisms for connecting to a MySQL server.
Your options:
- Create a browser plugin
- Write a web service and use JavaScript to create an XMLHttpRequest object to communicate with it.
The second option is the most common (and almost certainly the best, since it does not require the user to install the browser plug-in or provide direct access to the database to all your users).
If you want to use JavaScript, you can create your own web service (e.g.) Node.js and the mysql driver in npm .
source share