If you are a web developer or administrator, aside from administering your web server, you should also be administering your MySQL database in terms of security. This database is open source and is commonly used with the PHP web server scripting language; tons of useful applications are being developed with this kind of setup. This is good, but it opens up issues, which we'll discuss here along with their solutions.
When working with a developer or other people who need special access to your web site, do not always give them the root access (full access) for the MySQL server. Instead, you can assign privileges and provide them limited access to prevent possible leaking of accounts which can compromise the system.
For example, a developer's privileges can be limited to inserting tables, editing tables and creating databases. You could withhold the privilege of looking into other sensitive databases in the server.
One effective way to reduce the possibility of compromising your database is to restrict access to it using the IP address. You need to define your IP address and use that to configure MySQL so that, when other IP addresses try to access the database, they will be denied.
Also, if you use a web form to communicate with your web server, below are some tips you can use to restrict access to certain users, based on the specific country. For example, if you have a website that accepts form inputs from people living only in the USA, you can: