Comments - What is the difference between '<username>'@localhost vs '<username>'@'%'?
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
The
@localhostuser can only connect to MariaDB from the same machine where the server is located. The@%user is allowed to connect from anywhere. If you were to use something like'username'@'192.168.0.123'then the user would be only allowed to connect from that IP address.What the user is allowed to do on the database is controlled with the GRANT SQL command. By default newly created userd are allowed to do very little and access to the tables needs to be granted.