username mysql code example
Example 1: mysql current user
-- mysql current user:
SELECT USER();
-- or
SELECT CURRENT_USER();
Example 2: create mysql user
CREATE USER 'newuser'@'%' IDENTIFIED BY 'user_password';
GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'%';
SHOW GRANTS FOR 'newuser'@'%';
FLUSH PRIVILEGES;