Local database server: Use this command when connecting to a MySQL Server instance running on the same machine you are using. In the commands provided below, see the Common Command Options for information on each of the available options. The mysql command can be used to connect to either a local or remote database server. The main purpose of the mysql utility is to connect to a MySQL database server and open a simple SQL shell environment.
If you’re not familiar with the sudo command, see the Linux Users and Groups guide. Commands that require elevated privileges are prefixed with sudo. The steps in this guide are written for a non-root user.