转载地址:http://hi.baidu.com/mvp_xuan/item/5b093c3c5350f4fa96f88dd2
1、下载安装
2、启动服务
————————————————————————————————————————
D:\Program Files\MySQL Server 5.5\bin>mysqld
D:\Program Files\MySQL Server 5.5\bin>mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.
Your MySQL connection id is 1
Server version: 5.5.23 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
————————————————————————————————————————
3、修改密码
cmd:
D:\Program Files\MySQL Server 5.5\bin>mysqladmin -u root -p
Enter password:
Confirm new password: ********
输入root的空密码,即按回车,然后输入新的密码即可。
4、新建用户
mysql> grant select,insert,update,delete on mydb.* to
Query OK, 0 rows affected (0.00 sec)
5、显示数据列表
默认如下:
mysql> show databases;
+--------------------+
| Database
+--------------------+
| information_schema |
| mysql
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)
使用其中的mysql:
mysql> use mysql;
Database changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql
+---------------------------+
| columns_priv
| db
| event
……省略……
| user
+---------------------------+
24 rows in set (0.00 sec)
6、显示数据表的结构
mysql> describe db;
+-----------------------+---------------+------+-----+---------+-------+
| Field
+-----------------------+---------------+------+-----+---------+-------+
| Host
| Db
| User
……省略……
| Trigger_priv
+-----------------------+---------------+------+-----+---------+-------+
22 rows in set (0.00 sec)
7、建库
create database 数据库名;
8、建表
use 数据库名;
create table 表名 (字段设定列表);
9、删库和删表
drop database 数据库名;
drop table 表名;
10、将表中记录清空
delete from 表名;
11、显示表中的所有记录
select * from 表名;
12、管理数据库
13、其他
14、PHP5.4 for Apache ; php 5.4.0安装过程、方法、配置 ; Apache2.2支持php5.4的配置方法