Alter User Mysql Code Example


Example 1: mysql create user

CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON * . * TO 'user'@'localhost'; FLUSH PRIVILEGES;

Example 2: alter user mysql native password

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';

Example 3: change mysql password from command line

ALTER USER 'root'@'localhost' IDENTIFIED BY 'New-Password';

Example 4: alter user root mysql

ALTER USER 'root'@'localhost' IDENTIFIED BY 'newPassword';

Example 5: mysql set password for user

# `SET PASSWORD FOR <user> = PASSWORD('<plaintext_password>')` is deprecated SET PASSWORD FOR <user> = '<plaintext_password>'; FLUSH PRIVILEGES;

Example 6: change user mysql

[madegow@fedora20 ~]$ mysql -u root -p Enter password:  ... MariaDB [(none)]> select user() -> ; +----------------+ | user()         | +----------------+ | root@localhost | +----------------+ 1 row in set (0.00 sec)  MariaDB [(none)]> system mysql -u madegow -p Enter password:  ... MariaDB [(none)]> select user(); +-------------------+ | user()            | +-------------------+ | madegow@localhost|

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable