官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 井陉县| 祁东县| 同江市| 芒康县| 石门县| 修文县| 昌乐县| 新平| 延川县| 关岭| 桑植县| 永州市| 阿城市| 青龙| 青州市| 西青区| 陕西省| 霞浦县| 闵行区| 大理市| 伊宁市| 灌云县| 潍坊市| 新泰市| 三台县| 曲麻莱县| 牡丹江市| 淳安县| 金溪县| 肥西县| 昌邑市| 富顺县| 巴塘县| 梁平县| 山丹县| 调兵山市| 绥宁县| 宜兴市| 海安县| 巩留县| 永顺县|