Log in to MySQL first shell> mysql --user=root mysql If you have a password, you need to add the --password or -p option Adding Users mysql>CREATE USER 'finley'@'localhost' IDENTIFIED BY 'some_pass'; mysql>GRANT ALL PRIVILEGES ON *.* TO 'finley'@'localhost' WITH GRANT OPTION; mysql>CREATE USER 'finley'@'%' IDENTIFIED BY 'some_pass'; mysql>GRANT ALL PRIVILEGES ON *.* TO 'finley'@'%' WITH GRANT OPTION; mysql>CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin_pass'; mysql>GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost'; mysql>CREATE USER 'dummy'@'localhost'; Add users and set database specific permissions: mysql>CREATE USER 'custom'@'localhost' IDENTIFIED BY 'obscure'; mysql>GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON bankaccount.* TO 'custom'@'localhost'; mysql>CREATE USER 'custom'@'host47.example.com' IDENTIFIED BY 'obscure'; mysql>GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON expenses.* TO 'custom'@'host47.example.com'; mysql>CREATE USER 'custom'@'%.example.com' IDENTIFIED BY 'obscure'; mysql>GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON customer.* TO 'custom'@'%.example.com'; To delete a user: mysql>DROP USER 'jeffrey'@'localhost'; To change your password: mysql>SET PASSWORD FOR 'jeffrey'@'localhost' = PASSWORD('mypass'); Modify the password of the currently logged in user: mysql>SET PASSWORD = PASSWORD('mypass'); The above is the method of adding and modifying usernames and passwords in MySQL 5.6 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Summary of the unknown usage of "!" in Linux
>>: React Hooks Usage Examples
binlog is a binary log file that records all DML ...
Recently, I solved the problem of Docker and the ...
Preface We may have heard of the concept of rowid...
This article is from Tom Ewer's Managewp blog,...
React is different from Vue. It implements route ...
This method uses the drop-shadow filter in CSS3 t...
Quick Reading Why do we need to monitor SQL state...
I would like to share with you the graphic tutori...
This article example shares the specific code of ...
Table of contents 1. Integrate Ant Design Vue 2. ...
This article uses jQuery to implement the sliding...
This article uses an example to illustrate the us...
Table of contents 1. Index Basics 1. Types of Ind...
html <!DOCTYPE html> <html lang="en...
This article is based on Linux centos8 to install...