November, 2008
How to Configure Auto Reconnect in MySQL
The MySQL client library can perform an automatic reconnect to the server if it finds that the connection is down when you attempt to send a statement to the server to be executed. In this case, the library tries once to reconnect to the server and send the statement again. Automatic reconnection can be convenient [...]
How To Quickly Analyze All Tables in MySQL Database
ANALYZE TABLE analyzes and stores the key distribution for a table. The MySQL query optimizer is the magic inside MySQL that decides which keys, if any, to use to in the query. ANALYZE helps query optimizer to make accurate decisions by detailed analysis of the data, unlike query optimizer which makes quick analysis. The command [...]
How To Check, Repair & Optimize All Tables in All Databases
Here is a simple command to auto repair, check and optimize all the tables in all databases running on a MySQL server: mysqlcheck -u root -p –auto-repair –check –optimize –all-databases mysqlcheck is available in MySQL 3.23.38 and later. mysqlcheck uses the SQL statements CHECK TABLE, REPAIR TABLE, ANALYZE TABLE, and OPTIMIZE TABLE in a convenient [...]
How to Identify the version of the SG driver
Earlier versions of the sg device driver either have no version number (e.g. the original driver) or a version number starting with “2″. The drivers that support this new interface have a major version number of “3″. The sg version numbers are of the form “x.y.z” and the single number given by the SG_GET_VERSION_NUM ioctl() [...]
What the sg driver does?
The sg driver permits user applications to send SCSI commands to devices that understand them. SCSI commands are 6, 10, 12 or 16 bytes long [1]. The SCSI disk driver (sd), once device initialization is complete, only sends SCSI READ and WRITE commands. There a several other interesting things one might want to do, for [...]
How to Run MySQL Scripts To Create Data Tables
Another common feature of prepackaged applications written in MySQL is that they may require you to not only create the database, but also to create the tables of data inside them as part of the setup procedure. Fortunately, many of these applications come with scripts you can use to create the data tables automatically. Usually [...]
How to Grant Privileges to Users in MySQL
On many occasions you will not only have to create a database, but also have to create a MySQL username and password with privileges to access the database. It is not a good idea to use the root account to do this because of its universal privileges. MySQL stores all its username and password data [...]
How to configure Transparent Proxy With Bridging
If you are trying to setup a transparent proxy on a Linux machine that has been configured as a bridge, you will need to add one additional iptables command to what we had in section 5. Specifically, you need to explicitly allow connections to the machine on port 3128 (or any other port squid is [...]
How to define a Secure Virtual Host – Apache
Setting up virtual hosts is fairly straightforward. I will go through the basics of setting up a secure virtual host. In these examples, I use the .crt and .key file extensions. That is my personal way of avoiding confusion with the various files. With Apache, you can use any extension you choose – or no extension at all. All [...]
How to do a System Audit for your Linux box
Unfortunately, there is no such things as a standard Linux installation. The wide variety of servers available, coupled with each particular distribution’s installation options, make providing a ready made list impossible. The best that can be done is show you how to list all running services, and point you in the right general direction. Now [...]
