Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My mysql server is configured to not allow remote connection.

Should I seriously care about mysql user and password in this case?

share|improve this question
up vote 9 down vote accepted

It is very good that the mysql server is not required to support remote connections because it greatly reduces the attackable surface.

But you should consider defence in depth as a strategy to slow down an attacker or even reduce the impact of an attack.

Setting up a good password for the database users is no significant amount of work, so you should do that. That same is true for permissions that are likely not needed such as executing shell commands or creating stored procedures.

Fine tuning the permissions of the database users might be more difficult. So it might be more effective to spend effort elsewhere first. For example reviewing a web application for SQL injection vulnerabilities.

share|improve this answer
Whilst it's not entirely necessary, I take this strategy to near-extremes by running one of my more sensitive webapps over multiple SQL users, each with their own permissions. Each user is tuned to a specific role, and it's selected based on if a user is logged in, and which page they're using. Anonymous (i.e. non-logged-in) users only get SELECT access to certain tables, and INSERT access to log tables. It greatly reduces the attack surface. Of course, proper use of parameterized queries negates any injection possibility. – Polynomial Aug 5 '12 at 12:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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