Apache Roller 4.0 – Beginner's Guide
上QQ阅读APP看书,第一时间看更新

Time for action — installing MySQL

I've been using MySQL for as long as I can remember using web applications, PHP, and Java. I still can't believe it is open source, which means it's free! Well, at least the Community Server. There is also an Enterprise Server where you receive support and a lot of goodies from the MySQL team for a certain price, but as we're already experts at installing things on Windows, let's try the Community MySQL Edition.

  1. Open your web browser and go to the MySQL downloads web page on http://dev.mysql.com/downloads/. Then, scroll down until you locate the MySQL Community Server Download link, and click on it:
    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  2. You'll be taken to the MySQL 5.1 Downloads page. Scroll down until you locate the Windows downloads section, and click on the Windows Essentials (x86) Pick a mirror link:
    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  3. On the Select a Mirror web page, select the No thanks, just take me to the downloads! link:
    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  4. Scroll down the Select a Mirror web page until you find a mirror near your location, and click on the HTTP link (the following screenshot shows mirrors in the United States):
    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  5. Click on the Save File button in the Opening mysql-essential-5.1.XX-win32.msi dialog box and wait for the file to download through your web browser. Double-click on the downloaded file when the download process is complete.
  6. The Open File - Security Warning dialog box will appear next. Click on the Run button to open the MySQL Server 5.1 Setup Wizard:
    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  7. Click on the Next button to continue. In the Setup Type screen of the installation wizard, make sure the Typical setup option is selected and click on Next. The Ready to Install the Program dialog will show the Current Settings for the MySQL installation. Just click on Install to continue.
  8. After a few seconds (or minutes, depending on your computer speed), the MySQL Wizard will show you a MySQL Enterprise window. Click on Next twice to complete the installation process. At the end, you'll see a Wizard Completed dialog box, as shown in the following screenshot:
    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  9. Make sure the Configure the MySQL Server now box is selected, and click on the Finish button to close the MySQL Installation Wizard. The MySQL Server Instance Configuration Wizard will show up afterwards.
  10. Click on Next to continue. Choose the Detailed Configuration option and then click on Next:
    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  11. Select the Developer Machine option in the next dialog box, and click on Next to continue.
  12. Select the Multifunctional Database option in the next dialog box, and click on Next to continue.
  13. Leave the default settings for the InnoDB data file, and click on Next to continue:
    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  14. Select the Decision Support (DSS)/OLAP option in the next dialog, and click on Next to continue.
  15. Make sure the Enable TCP/IP Networking option is selected. Leave the Port Number as 3306, and select the Enable Strict Mode option too. Click on Next when you're ready:
    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  16. Select the Best Support for Multilingualism option and click on Next to continue.
  17. Select the Install As Windows Service option on the next dialog. Make sure the Launch the MySQL Server automatically box is selected. Select the Include Bin Directory in Windows PATH option, and click on Next to continue:
    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  18. In the next dialog, make sure the Modify Security Settings option is selected. Enter a password in the New root password: and Confirm: fields.

    Note

    Don't forget this password, because without it you won't be able to access the MySQL client to create databases later.

    Make sure the Enable root access from remote machines and the Create an Anonymous Account options are disabled. Click on Next to continue:

    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  19. The MySQL Server Instance Configuration Wizard is now ready to prepare and write the configuration file to disk, start the MySQL service and apply the security settings:
    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  20. Press the Execute button to continue. The Wizard will show you when it has completed every stage of the configuration process. When the wizard completes its task, just press the Finish button to close it.
  21. To test the MySQL installation, open a Command Prompt window and type mysql -u root -p, followed by Enter. The MySQL monitor will prompt for a password. Enter the password you used at the time of installation and hit Enter. The monitor then responds with a welcome message, as shown in the following screenshot:
    Time for action — installing MySQLMySQL database server, Roller installation on Windowsabout
  22. Type exit to close the MySQL monitor and close the Command Prompt window.

What just happened?

Now you have all the open source software required to install Apache Roller on your Windows machine. This last exercise showed you that MySQL server is a bit more complicated to install than Apache, Java, and Tomcat. That's because there are a lot of settings to consider when using this powerful database server.

In step 10 of the previous exercise (use the screenshot shown in step 10 as a reference), you had two choices—Detailed Configuration and Standard Configuration. If you select the standard configuration, the installation process will be shorter. However, for Apache Roller, there are some special settings that we need to adjust on MySQL server and the standard configuration doesn't include them. There are some other settings, that although not necessarily involved with the Apache Roller installation process, will indeed help to improve your machine's performance, and consequently, your Apache Roller blog server's performance.

For example, in step 11 you have the following options about memory usage:

  • Developer Machine: This option is for testing applications such as Apache Roller, because MySQL server uses just the minimal memory space it requires to work, without burdening the host computer. If you're going to run a personal blog on your home PC (where you use several applications, such as a word processor, spreadsheets, games, and so on), this is the recommended option.
  • Server Machine: This option is for running Apache Roller on a dedicated web server machine. You can have a personal blog or several multiuser blogs, it all depends on your machine's hardware.
  • Dedicated MySQL Server Machine: If you run a big company, you could assign a dedicated machine to act as a database server with MySQL, and use another machine for the Apache web server and the Tomcat servlet engine. This way you could host thousands of blogs with Apache Roller!

Steps 12, 13, and 14 of the installation process are not directly related to the Apache Roller installation requirement, that's why we just left the default options selected, and moved along.

Steps 15 and 16 are very important for a successful Apache Roller installation. You need to enable TCP/IP networking so that Roller can connect with the MySQL server through a TCP/IP port, and the default character set must be UTF-8.

Step 17 is for installing MySQL server as a Windows service; that means MySQL server will startup and shutdown automatically each time you start/restart your PC. This step also lets you add the MySQL server and client executables to the Windows PATH variable, so you can use the MySQL monitor program to create or delete databases, as we will see later when installing Apache Roller.

The last configuration step is where you enter a password for the MySQL root user. This is the administrator user who has the power to create, delete, or modify any database handled by MySQL. So be careful with the password, because anyone could delete your entire blog! I definitely recommend you change the root user password frequently, to enhance the overall security of your blog server.

That pretty much covers all you'll need to know about MySQL to run your own Apache Roller blog server. Finally, we've came to the point you've been waiting for since you started reading this book.