3

Is there a way to restrict users from accessing a particular database/schema within MySQL?

I want to create a database/schema that only I can access.

I also want to change the password of the "mysql" user but I do not see this user in the mysql.user table even though I was able to use this user to login to mysql.
I tried changing the password of the user by executing the statement - mysqladmin --user=mysql --password=oldpassword password "newpassword". But now I am not able to login this user altogether. I've tried both the old and the new passwords.
I am wondering if my changing this password can impact any mysql service running on the system.

Neha
  • 153
  • 3
  • 18
  • you must establish user permissions in the database, to give access to certain things that the administrator decides. https://dev.mysql.com/doc/refman/8.0/en/grant.html – A. M. Mérida Apr 27 '18 at 10:17

1 Answers1

1

For restricting table and schema you can use the GRANT, you can set permission for each user or group on a particular tables for more details : Tutorial on Grant for mysql

For your access the answer is already on stackoverflow :How do I retrieve my MySQL username and password?

Hope that can help you

Nikoala
  • 71
  • 1
  • 10
  • Thanks! .. But I don't see this user in mysql.user table. The username is "mysql". I guess this user is the owner of the whole mysql functionality. – Neha Apr 27 '18 at 10:18