13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Contents<br />

xvii<br />

Rows 209<br />

Values 209<br />

Keys 209<br />

Schemas 210<br />

Relationships 211<br />

Designing Your <strong>Web</strong> Database 211<br />

Think About the Real-World Objects You Are<br />

Modeling 211<br />

Avoid Storing Redundant Data 212<br />

Use Atomic Column Values 214<br />

Choose Sensible Keys 215<br />

Think About What You Want to Ask the<br />

Database 215<br />

Avoid Designs with Many Empty<br />

Attributes 215<br />

Summary of Table Types 216<br />

<strong>Web</strong> Database Architecture 216<br />

Further Reading 218<br />

Next 218<br />

9 Creating Your <strong>Web</strong> Database 219<br />

Using the <strong>MySQL</strong> Monitor 220<br />

Logging In to <strong>MySQL</strong> 221<br />

Creating Databases <strong>and</strong> Users 222<br />

Setting Up Users <strong>and</strong> Privileges 223<br />

Introducing <strong>MySQL</strong>’s Privilege System 223<br />

Principle of Least Privilege 223<br />

User Setup:The GRANT Comm<strong>and</strong> 223<br />

Types <strong>and</strong> Levels of Privileges 225<br />

The REVOKE Comm<strong>and</strong> 227<br />

Examples Using GRANT <strong>and</strong> REVOKE 227<br />

Setting Up a User for the <strong>Web</strong> 228<br />

Using the Right Database 229<br />

Creating Database Tables 229<br />

Underst<strong>and</strong>ing What the Other Keywords<br />

Mean 231<br />

Underst<strong>and</strong>ing the Column Types 232

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!