Microsoft Windows [Version 6.0.6001]
(C) Copyright 1985-2005 Microsoft Corp.
C:\Users\david>
C:\Users\david>mysql -uwww -pwww
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.1.34-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
C:\Users\david>mysql -uroot -padmin
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.1.34-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases ;
+--------------------+
Database
+--------------------+
information_schema
mysql
shoppingmall
test
+--------------------+
4 rows in set (0.00 sec)
mysql> create database shopppingmall ;
Query OK, 1 row affected (0.01 sec)
mysql> show databases ;
+--------------------+
Database
+--------------------+
information_schema
mysql
shop
shoppingmall
test
+--------------------+
5 rows in set (0.00 sec)
mysql> grant all privileges on shoppingmall.* to www@localhost identified by 'www' ;
Query OK, 0 rows affected (0.06 sec)
mysql> exit
Bye
C:\Users\david>mysql -uwww -pwww
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.1.34-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use shoppingmall ;
Database changed
mysql> show tables ;
Empty set (0.00 sec)
mysql> create table users(userid varchar(12) not null primary key ,
-> username varchar(30) not null ,
-> email varchar(30) , phone varchar(30) ,
-> address varchar(250) ) ;
Query OK, 0 rows affected (0.06 sec)
mysql> desc users ;
+----------+--------------+------+-----+---------+-------+
Field Type Null Key Default Extra
+----------+--------------+------+-----+---------+-------+
userid varchar(12) NO PRI NULL
username varchar(30) NO NULL
email varchar(30) YES NULL
phone varchar(30) YES NULL
address varchar(250) YES NULL
+----------+--------------+------+-----+---------+-------+
5 rows in set (0.04 sec)
mysql> insert into users values('sss','df','fdsfdsf','1111','ffds') ;
Query OK, 1 row affected (0.00 sec)
mysql> select * from users ;
+--------+----------+---------+-------+---------+
userid username email phone address
+--------+----------+---------+-------+---------+
sss df fdsfdsf 1111 ffds
+--------+----------+---------+-------+---------+
1 row in set (0.00 sec)
mysql>
댓글 없음:
댓글 쓰기