본문 바로가기
I T/Linux

mysql db 생성 테이블 생성

by 루솨 2015. 8. 30.
mysql> create database arp;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on arp.* to arp@localhost identified by 'smile_test@mrtg' with grant option;
Query OK, 0 rows affected (0.00 sec)

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

mysql> use arp;
Database changed
mysql> CREATE TABLE `members` (
    -> `id` int(4) NOT NULL auto_increment,
    -> `username` varchar(65) NOT NULL default '',
    -> `password` varchar(65) NOT NULL default '',
    -> PRIMARY KEY (`id`)
    -> ) TYPE=MyISAM AUTO_INCREMENT=2 ;
Query OK, 0 rows affected, 1 warning (0.14 sec)

mysql> INSERT INTO `members` VALUES (1, 'test', 'test1234');
Query OK, 1 row affected (0.00 sec)

mysql> use arp;
Database changed
mysql> show tables;
+---------------+
| Tables_in_arp |
+---------------+
| members       |
+---------------+
1 row in set (0.00 sec)

mysql> select * from members;
+----+----------+------------+
| id | username | password   |
+----+----------+------------+
|  1   |     test     |    test1234   |
+----+----------+------------+
1 row in set (0.00 sec)

mysql>