How to exit from a mysql database?
To exit the MySQL database, you can use one of the following methods:
Exit using the command line tool.
Type mysql in terminal or command prompt, then press Enter to access the MySQL command line interface.
Type “quit;” or “\q” to exit the MySQL command line interface.
Exit using shortcut keys.
To exit the MySQL command line interface, press Ctrl + D (for MacOS) or Ctrl + Z (for Windows/Linux).
3. Exit using SQL command:
To exit the MySQL Command Line Interface, type EXIT; or QUIT;.
Regardless of the method used, you will be disconnected from the current MySQL session and returned to the command line interface of the operating system.