Environments

MySQL is rarely queried in isolation; most applications reach it through a host programming language and its MySQL driver. This chapter surveys the most common ways to connect to and query a MySQL server from application code, and closes with a brief comparison of MySQL against other popular SQL database engines.



An Alternative: JavaScript Inside the Server

Every environment above reaches MySQL from the outside, over a client connection. As of MySQL 9.0, MySQL Enterprise Edition offers a different option: JavaScript stored programs that run inside the server itself, via the MySQL Multilingual Engine (MLE) (CREATE FUNCTION/ PROCEDURE ... LANGUAGE JAVASCRIPT). This is not a Community Edition feature, and it does not replace PHP, Python, or Node.js as a client environment – it is a way to move certain logic next to the data instead of round-tripping it through the network. See Compound Statements for the full syntax and details.