Ip address
CREATE USER john@127.0.0.1
Hostname
CREATE USER john@localhost
Domain name
CREATE USER john@'%.codewithmosh.com'
No restriction and set password
CREATE USER john IDENTIFIED BY '1234';
SELECT * FROM mysql.user;
Or on the left side -> open Administration -> Users and Privileges
CREATE USER bob@codewithmosh.com IDENTIFIED BY '1234';
DROP USER bob@codewithmosh.com;
For a certain user:
SET PASSWORD FOR john = '1234';
For current user:
SET PASSWORD = '1234';
Or on the left side -> open Administration -> Users and Privileges ->change/expire password -> apply
1: web/desktop application
CREATE USER moon_app IDENTIFIED BY '1234';
GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE
ON sql_store.*
TO moon_app;
Search mysql privileges 2: admin
GRANT ALL
ON *.* -- all databases and all tables
TO john
For a certain user:
SHOW GRANTS FOR john;
For current user
SHOW GRANTS;
Or on the left side -> open Administration -> Users and Privileges -> Administrative Roles/Schema Privileges
REVOKE CREATE VIEW
ON sql_store.*
FROM moon_app;
Take security seriously, always grant the minimum required for user account.