Difference between 'username'@localhost vs. 'username'@'%'

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

Difference between 'username'@localhost vs. 'username'@'%'

Postby nkamp01 » 09. July 2023 13:40

Hello,

What is the difference between:
CREATE USER 'username'@localhost IDENTIFIED BY '<password>';
CREATE USER 'username'@'%' IDENTIFIED BY '<password>';
nkamp01
 
Posts: 3
Joined: 09. July 2023 13:25
XAMPP version: xampp-portable-windows-x64-8.2
Operating System: Windows

Re: Difference between 'username'@localhost vs. 'username'@'

Postby Altrea » 10. July 2023 07:02

username@localhost can connect only from the machine the MariaDB Daemon is running on (for example by a php script if php is running on the same machine as MariaDB)
username@% can access from any host.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 47 guests