Does JavaScript support MySQL database connections?
P粉555682718
P粉555682718 2023-08-20 18:02:52
0
2
451
<p>Can JavaScript connect to MySQL? If so, how? </p>
P粉555682718
P粉555682718

reply all(2)
P粉921165181

Client-side JavaScript cannot access MySQL directly unless there is some kind of bridge. But the statement in the bold statement above that JavaScript is only a client-side language is incorrect - JavaScript can run both client-side and server-side, such as Node.js.

Node.js can access MySQL through a method similar to https://github.com/sidorares/node-mysql2.

You can also develop something using Socket.IO.

Do you want to ask whether the client JS application can access MySQL? I'm not sure if such a library exists, but it's possible.

EDIT: Since writing this we now have MySQL Cluster:

P粉295728625

No, JavaScript can not directly connect to MySQL. But you can mix JS with PHP to do so.

JavaScript is a client-side language, while your MySQL database will run on the server.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!