Chapter 5. Protecting Your Data

In This Chapter

  • Understanding MySQL data security

  • Adding new MySQL accounts

  • Modifying existing accounts

  • Changing passwords

  • Making backups

  • Repairing data

  • Restoring data

Your data is essential to your Web database application. You have spent valuable time developing your database, and it contains important information entered by you or by your users. You need to protect it. In this chapter, I show you how.

Controlling Access to Your Data

You need to control access to the information in your database. You need to decide who can see the data and who can change it. Imagine what would happen if your competitors could change the information in your online product catalog or copy your list of customers — you'd be out of business in no time flat. Clearly, you need to guard your data.

MySQL provides a security system for protecting your data. No one can access the data in your database without an account. Each MySQL account has the following attributes:

  • A name

  • A hostname — the machine from which the account can access the MySQL server

  • A password

  • A set of privileges

To access your data, someone must use a valid account name and know the password associated with that account. In addition, that person must be connecting from a computer that's permitted to connect to your database via that specific account.

After the user is granted access to the database, what he or she can do to the data depends on what privileges have been set for the account. Each account is either allowed ...

Get PHP and MySQL® For Dummies®, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.