I have a MySQL Community database on a remote server and I am trying to get Microsoft Access to read data from it. This data is sensitive. The problem is, MySQL doesn't care about the username that I give it in the .DSN file. It lets me read the ENTIRE database no matter what! How do I get it to actually check the username that I give it in the .DSN file?

edit: I'm not a DBA, I'm some intern who is over his head. Please don't assume that I know anything about anything :)


I strongly suspect this is not an issue of MySQL "not checking" the username, but rather permissions which are too broad.

Start with SELECT * FROM mysql.db WHERE Db = 'yourdb'; and ensure that only the desired permissions are set for your DB.

  • 0 rows returned. (I replaced yourdb with my db name) – danielcg Mar 8 '18 at 21:17
  • Drop the where statement - there should really be rows there – Ben Yanke Mar 8 '18 at 21:22
  • Nothing was showing up because the user accounts all have % under 'Db'. There are rows for mysql.session and mysql.sys, plus the user accounts that I made, and the last line says "NULL" for each field. Could the null line be the issue? – danielcg Mar 8 '18 at 21:26
  • You shouldn't be really editing permissions in that table, that's just a simple way to view them. – Ben Yanke Mar 8 '18 at 21:28
  • You need to lock down all your permissions and only open them back up to specific resources where needed. This will solve your problem, I suspect – Ben Yanke Mar 8 '18 at 21:28

I figured it out. The server thought that it was started with -skip-grant-tables, which allows anyone to login as any user with any password. This option wasn't even enabled, but I tried running "FLUSH PRIVILEGES;" and that solved the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.