Neha
Neha

Reputation: 163

MySQL - Restrict access to a database

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.

Upvotes: 3

Views: 4583

Answers (1)

Nikoala
Nikoala

Reputation: 89

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

Upvotes: 1

Related Questions