In WordPress “MySQL” is a Data Base Management System (DBMS) that is used to store and retrieve all the information related to your blog. WordPress uses MySQL as an open source database management system for storing and retrieving all of your website’s information from the content of your posts and pages to your comments, usernames and passwords.
MySQL is a main component in the LAMP stack of open source web application software that’s used to create websites. LAMP stands for Linux, Apache, MySQL and PHP. It is also used in the LEMP stack, which replaces Apache for Nginx.
WordPress uses PHP for storing and retrieving data from MySQL databases, using SQL queries within the PHP markup.
Example, suppose if you’re a member of a WordPress-powered membership site.Here SQL is used for logging you in, retrieving your unique membership ID, check that you have an active membership, and ensure the correct profile data is displayed on the front-end.