I set up a project on the remote server and need to configure database parameters; for that, I want to create a separate user and give him access only to one database. Please tell me how to create a new user and give whole access to him.
To create new user within the MySQL shell you need to run:
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
To provide user whole access to your database run:
GRANT ALL PRIVILEGES ON myDatabase. * TO 'newuser'@'localhost';
You can also provide access to the single table:
GRANT ALL PRIVILEGES ON myDatabase.myTable TO 'newuser'@'localhost';
If you want to provide access to whole databases you can run:
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
After that be sure to reload all the privileges.
For more details check here
- 1Bitbucket and Visual Studio
- 1How to dump and restore database in MongoDB
- 1How to compress and extract files/folders using the tar command on Ubuntu
- 5What is "marquee" tag and how I can use it in HTML?
- 2How to Change the cursor to a hand when a user hovers over a list item?
- 1What is the difference between setTimeout and setInterval?
- 1How to create snackbar in flutter?
- 3What's the difference between using “let” and “var”?
- 1Abstract and Virtual Methods
- 1What is PATH, and when to use it in C++
- 11Is it possible to create an HTML button that acts like a link?