MySQL stores user data in a table called user
in a database named mysql
(by default). The following query will return 1
if a user with the specified username exists, 0
otherwise.
SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user="username")
MySQL stores user data in a table called user
in a database named mysql
(by default). The following query will return 1
if a user with the specified username exists, 0
otherwise.
SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user="username")