Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1188319
  • 博文数量: 89
  • 博客积分: 10546
  • 博客等级: 上将
  • 技术积分: 1510
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-16 01:24
文章分类

全部博文(89)

文章存档

2012年(7)

2011年(4)

2010年(5)

2009年(52)

2008年(21)

分类:

2008-10-23 09:22:02

创建数据库

你可以通过命令行或MySQL官方的客户端工具来创建数据库。这里以命令行为例说明。

[hantsy@localhost public_html]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.51a Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>


创建数据库cakeblog。

mysql> create database cakeblog;
Query OK, 1 row affected (0.01 sec)


创建用户cakeuser。

mysql> create user cakeuser identified by 'cakeuser';
Query OK, 0 rows affected (0.08 sec)


给用户cakeuser 分配权限。

mysql> grant all privileges on cakeblog.*  to 'cakeuser'@'localhost' identified by 'cakeuser';
Query OK, 0 rows affected (0.00 sec)


让权限立生效。

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)



现在再打开http://localhost/cakeblog。

OK,基本的配置已经完成了。
阅读(1715) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~