Sun Microsystems (JAVA) this morning announced that it will buy MySQL, maker of open-source database software, for about $1 billion, including $800 million in cash and the assumption of $200 million in options. The deal is expected to close in the company’s third or fourth fiscal quarter. Sun says the deal will be accretive to fiscal year 2010 operating income on a GAAP basis.

MySQL CEO Marten Mickos will join Sun’s senior executive team, the company said.

Meanwhile, Sun today also said that it expects to report revenue for the fiscal second quarter ended December 30 of $3.6 billion, a hair above the Street consensus of $3.58 billion. GAAP EPS is expected to be 28-32 cents; the consensus is 29 cents. Sun says bookings in the quarter were about $3.85 billion, up 7% year over year.

Sun shares this morning are up 57 cents, or 3.8%, at $15.55.