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
Preface When installing the executable file of a ...
Importing data with incorrect MySQL character set...
01 Winter Flakes (Individual only) 02 Snowtop Cap...
Table of contents 1. What is a calculated propert...
Table of contents specification a. The page file ...
Table of contents 1. What is Docker Compose? 2. D...
Table of contents What is axios? Axios request ty...
<body> <div id="root"> <...
How to install and configure mysql-5.7.5-m15-winx...
Some time ago, the blogger installed the Ubuntu s...
Sometimes you may encounter a situation where a S...
Table of contents 1. Vue life cycle 2. Hook funct...
1. Inline styles To add inline styles to the virt...
Preface This article records a common SMS verific...
Unique “About”-Pages A great way to distinguish yo...