Sun will spend $800m to purchase all shares of the open source database firm, plus an additional $200m to cover "options".
The vendor plans to position MySQL with its other web application offerings and bundle the database software with its commercial products.
MySQL will be divided among Sun's Software, Sales and Service groups, and MySQL chief executive Martin Mickos will be given an executive position at Sun.
"MySQL's employees and culture, along with its near ubiquity across the web, make it an ideal fit with Sun's open approach to network innovation," said Sun president and chief executive Jonathan Schwartz.
"And most importantly, this announcement boosts our investments into the communities at the heart of innovation on the internet and of enterprises that rely on technology as a competitive weapon."
Charles King, principal analyst at Pund-IT, suggested that the acquisition could create friction between Sun's open source efforts and its proprietary software business.
The analyst added that Sun has endured criticism in the past for its reluctance to open its code.
"MySQL could create numerous commercial opportunities for Sun, and may strengthen Sun's credibility among open source adherents," King wrote.
"However, those same folks are likely to keep a very close watch on how the company manages MySQL."
EE, O2, Vodafone, Three and Airspan open the bidding
Worried about data privacy? Here are several ways to secure your Facebook account
The ICO is seeking an urgent warrant to investigate a major data breach - everything you need to know as the story continues to unfold