Exploring users and accounts
Most applications define an account as a username and a password. Then, permissions are assigned to this account. For MySQL, it is mostly the same, but there are some important differences. The first difference is that, for MySQL, an account is written as <user>@<host>
instead of only the username. The permissions are assigned to such user and host combinations. This is important and means that [email protected]
and [email protected]
are two different accounts that can have different permissions. It also allows you to restrict access to specific hosts or IP ranges. In the next section, we will explore how to connect to MySQL with a set of credentials.
How to connect to MySQL with a set of credentials
Essentially, this is similar to what you have already been using before, but we will refresh your memory regarding this process.
To connect to the MySQL client, the code needs to be in the following format:
mysql -h <host> -u...