Now this may be common practice for some of you all, but not all.
I’d recommend the (security) practice of having separate databases for your different environments; e.g. development, testing and production. Say for a given user ‘kzhiwei’, I should have up to three databases available for use:
PHPMyAdmin provides excellent support for this function by means of its database selector dropdown, it displays databases the logged in user has access to like:
The following is MySQL syntax with the following points:
- localhost-only access is provided
- usage of the MySQL server, sans access to other databases
- wildcard access to ALL databases that are named like “kzhiwei_”
CREATE USER 'kzhiwei'@ 'localhost' IDENTIFIED BY 'password'; GRANT USAGE ON * . * TO 'kzhiwei'@ 'localhost' IDENTIFIED BY 'password' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ; GRANT ALL PRIVILEGES ON `kzhiwei_%` . * TO 'kzhiwei'@ 'localhost';