Summary

MySQL has a host of tools to make administering the database server as painless a task as possible. But the more critical your data, and the larger your tables, the more important it is that you can competently and quickly handle problems when they occur. You can stop and start the MySQL server in a number of ways, such as using mysqld directly, but it is highly recommended that you use a wrapper script, such as the mysqld_safe script supplied with distributions.

Windows and Unix have quite different methods of automating startups, but both are fairly easy to implement once you know what you are doing.

The configuration files are a flexible way of controlling the server's behavior, and you'll learn more about them for optimization purposes in Chapter 13, "Configuring and Optimizing MySQL."

When disaster strikes, the log files can be invaluable in helping to identify the problem, whether it was a query or some other unforeseen error. They are also helpful in restoring from backups. They can also help with more mundane tasks, such as identifying slow queries for optimization purposes. Of course, they can grow out of control quite quickly, and rotating them so as to avoid the problem of them infinitely growing is also an important task.

Regular maintenance of the tables is the best way to avoid problems. Optimizing tables defragments them, and it is also useful to update the key information to assist MySQL in making query join decisions based upon up-to-date information about the data. But in spite of the best efforts, unforeseen power spikes, hardware failures, or human error can lead to data corruption (especially in indexes), in which case the various repair options are invaluable. The older myisamchk utility is more useful when the server is down, and the mysqlcheck utility can perform maintenance tasks while the server is still running (as can the related SQL statements).

The next chapters will investigate these topics in more detail: database security, replication, and configuration.



Mastering MySQL 4
Mastering MySQL 4
ISBN: 0782141625
EAN: 2147483647
Year: 2003
Pages: 230
Authors: Ian Gilfillan

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net