50 lines
2.0 KiB
Plaintext
50 lines
2.0 KiB
Plaintext
CREATE USER 'kristofer' IDENTIFIED BY 'secret';
|
|
SELECT user, plugin FROM mysql.user ORDER BY user;
|
|
user plugin
|
|
kristofer sha256_password
|
|
mysql.session mysql_native_password
|
|
mysql.sys mysql_native_password
|
|
root mysql_native_password
|
|
root mysql_native_password
|
|
root mysql_native_password
|
|
root mysql_native_password
|
|
user() current_user()
|
|
kristofer@localhost kristofer@%
|
|
user() current_user()
|
|
kristofer@localhost kristofer@%
|
|
user() current_user()
|
|
kristofer@localhost kristofer@%
|
|
DROP USER 'kristofer';
|
|
GRANT ALL ON *.* TO 'kristofer'@'localhost' IDENTIFIED BY 'secret2';
|
|
Warnings:
|
|
Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement.
|
|
user() current_user()
|
|
kristofer@localhost kristofer@localhost
|
|
user() current_user()
|
|
kristofer@localhost kristofer@localhost
|
|
user() current_user()
|
|
kristofer@localhost kristofer@localhost
|
|
SHOW GRANTS FOR 'kristofer'@'localhost';
|
|
Grants for kristofer@localhost
|
|
GRANT ALL PRIVILEGES ON *.* TO 'kristofer'@'localhost'
|
|
DROP USER 'kristofer'@'localhost';
|
|
GRANT ALL ON *.* TO 'kristofer'@'localhost' IDENTIFIED BY '123';
|
|
Warnings:
|
|
Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement.
|
|
user() current_user()
|
|
kristofer@localhost kristofer@localhost
|
|
user() current_user()
|
|
kristofer@localhost kristofer@localhost
|
|
user() current_user()
|
|
kristofer@localhost kristofer@localhost
|
|
SHOW GRANTS FOR 'kristofer'@'localhost';
|
|
Grants for kristofer@localhost
|
|
GRANT ALL PRIVILEGES ON *.* TO 'kristofer'@'localhost'
|
|
DROP USER 'kristofer'@'localhost';
|
|
GRANT ALL ON *.* TO 'kristofer'@'33.33.33.33' IDENTIFIED BY '123';
|
|
Warnings:
|
|
Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement.
|
|
Connection should fail for localhost
|
|
ERROR 28000: Access denied for user 'kristofer'@'localhost' (using password: NO)
|
|
DROP USER 'kristofer'@'33.33.33.33';
|