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

Time for action — creating a MySQL database for Roller

In this exercise, you'll use the MySQL monitor to create a database for your Apache Roller blog site.

  1. Open a command prompt window (Start | All Programs | Accessories | Command Prompt) and type mysql -u root -p.
  2. The MySQL monitor will ask you to Enter Password. This is the password you used when installing MySQL Server. Type it and press Enter. If the password is correct, the following screen shall appear:
    Time for action — creating a MySQL database for Roller
  3. Now type the following lines after the mysql> prompt (remember to replace password with a secure password) and press Enter after each line:
    create database rollerdb;
    grant all on rollerdb.* to roller_user@'%' identified by 'password';
    grant all on rollerdb.* to roller_user@localhost identified by 'password';
    
  4. When finished, your screen should look like this:
    Time for action — creating a MySQL database for Roller
  5. Notice the Query OK, 0 rows affected (X.XX sec) line after each line you typed. It means there were no errors with the commands you entered. Now type exit and press Enter to exit the MySQL monitor, then type exit to close the Command Prompt window.

What just happened?

In this last exercise, you used the MySQL monitor to create the rollerdb database, and then created a database user named roller_user. You then assigned permissions to roller_user, so it can create, modify, and delete tables inside the rollerdb database. Note that the password you used for the rollerdb database isn't the same as your MySQL root user's password. Remember that the "root" user has access to all the MySQL server configuration, and the user named roller_user only has access to your rollerdb database.