You can connect to MySQL from Javascript through a JAVA applet. The JAVA applet would embed the JDBC driver for MySQL that will allow you to connect to MySQL.
请记住,如果您想连接到远程 MySQL 服务器(除了您从中下载 applet 的服务器之外) ,您需要请求用户授予 applet 扩展权限。默认情况下,applet 只能连接到下载它们的服务器。
Yes you can. MySQL connectors use TCP for connection, and in JS there is an little modified version of TCP client called Websocket. But you can't directly connect to MySQL server with websocket. You will need some 3rd party bridge between websocket and mysql. It receive query from websocket, send it to mysql, response result and resend to JS.