How do you test MySQL credentials from the command line on a Linux server?
|
@Phil's Answer and @Mr.Brownstone's Answer should suffice for your question, so +1 for both of them. For the following, let's assume you are logging in with username Once you have connected to mysql, you should run the following query:
Sometimes, they are different. This may give you insight into why you are allowed to login to mysql. Here is another query you need to run:
This will show you the ways in which you are allowed to login as If you see If you see If you see If you see Once you see what 'mysql.user' has for your user, you may want to allow or restrict myuser from logggin in one way and not the other. If you simply want to check if the password for
You can check from the command line as follows
If you are not root and want to test myuser only, you can do this:
If you get 1, password for myuser is verfiied as good. |
||||
|
|
|
You can use the following command (assuming that you have mysql set up in your PATH):
Just replace host and user with the correct values and then you should be prompted for your password. I hope this helps you. |
|||
|
Is your question that simple, or is there a specific case you need to test? |
|||
|
|

