Monday, July 9, 2012

Step by step guide on installing MYSQL on Windows


1.Unzip the setup file and execute the downloaded MSI file.
2.Follow the instructions below exactly when installing MySQL Server:
3.Set the type you want : typical, complete or custom
4.Then click the button install
5.Now wait for about a minutes to finish installing
6.Wizard completed, click the button finish.
7.Mysql server instance configuration: click the detailed configuration, click next,
  click developer machine, and click next.
8.Select now the database usage: mulfunctional, transactional, or nontransactional.
  and click next until the configuration is successful.





Repairing, Checking, Analyzing, and Optimizing in mysql


OPTIMIZING
Optimization is a complex task because ultimately it requires understang of the entire system to be optimized.
Although it may be possible to perform some local optimizations with little knowledge of your system or application,the more optimal you want your system to become, the more you must know about it.

REPAIRING
Repairing- If your checks reveals errors, or if you see cryptic error messages about table handlers or corrupt indexes,then you need to try repairing the table. Before repairing a corrupted table is to back it up.
Never try running a repair operation on a table without backing it up. If you fail.
Your data might be in worse shape than originally and may even become unsalvageable.

CHECKING
Checking- Thew mysql database is automatically checked weekly to verify the health of the database.
This check takes about an hour. If any errors are found, a report is sent to the administrator’s account.
The report name that runs the mysql checked is zmbintegrityreport, and the crontab is automatically configured to run this report once a week.

ANALYZING
Analyzing – examines the result from a query and returns an analysis of the results that suggest optimal data types for each column that may help reduce table sizes. To obtain this analysis, append procedure analyze to the end of a select stament.

MYSQL LOGS


BINARY LOG
The Binary Log- The binary log contains “events” that describe the database changes such as table creation operations or changes to table data.It also contains events for statements that potentially could have made changes. The binary log has two important purposesFor replication, the binary log is used on master replication servers as a record of the statements to be sent to slaves,which execute those events to make the same data changes that were made on the masterCertain data recovery operations require use of the binary log. After a back-up has been restored, the events in binary log that were recordedafter the back-up was made are re-executed. These events bring databases up to date from the point of the back-up.

SLOW QUERY LOG
Slow Query Log- The slow query log consist of sql statements that took more than long query time seconds to execute.The minimum and default values of long query time are 1 and 10, respectively.The time to acquire the initial table looks is not counted as execution time.Mysqld writes the statement to the slow query log after it has been executed and after all locks have been released,so log order might differ from execution order.

ERROR LOG
The error log- the error log contains information indicating when mysqld was started and stopped and also any critical errors that occur while the server is running. If mysqld notices a table that needs to be automatically checked or repaired , it writes the message to the error log.On some operating systems, error log, contains a stack trace if mysqld dies. The trace can be used to determine where mysqld died.

GENERAL QUERY LOG
The general query log- is the general record of what mysqld doing. The server writes the information to this log when clients connector disconnect, and it logs each SQl statement received from clients. The general query log can be very useful when you suspect an errorin a client and want to know exactly what the client sent to mysqld.Mysqld write statements to the query log, in the order that it receives them, which might differ from the order in which they are executed.This logging order contrasts to the binary log, for which statements are written after they are executed but before any locks are released.