mysql> create database bob; Query OK, 1 row affected (0.02 sec) mysql> grant all on bob.* to bob@localhost; Query OK, 0 rows affected (0.01 sec) mysql> use bob Database changes
That was easy. Let's create a table for Bob to use:
mysql> create table messages ( -> number int(6), -> sender varchar(250), -> text varchar(250) -> ); Query OK, 0 rows affected (0.02 sec)
We can now look at the description of this table:
mysql> describe messages; +--------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +--------+--------------+------+-----+---------+-------+ | number | int(6) | YES | | NULL | | | sender | varchar(250) | YES | | NULL | | | text | varchar(250) | YES | | NULL | | +--------+--------------+------+-----+---------+-------+ 3 rows in set (0.00 sec)
Okay, that looks good. Now to enter a tuple of data. (Tuples are often called records.)
mysql> INSERT INTO messages VALUES ('1', 'admin', 'Hello Bob, how are you?'); Query OK, 1 row affected (0.03 sec)
Now we can look at the table to see if the record is there:
mysql> select * from messages; +--------+--------+-------------------------+ | number | sender | text | +--------+--------+-------------------------+ | 1 | admin | Hello Bob, how are you? | +--------+--------+-------------------------+ 1 row in set (0.00 sec)
It looks like the tuple is there.