:: กลับหน้าแรก :: แสดงเนื้อหาทั้งหมด ::
5.2 วิธีใช้งาน Mysql เบื้องต้น: เพื่อให้เห็นการทำงานอย่างง่าย ๆ ของ Mysql ก่อนนำไปใช้ในภาษาอื่น
ตัวอย่างข้างล่างนี้จะแสดงการสร้างตาราง แสดงข้อมูล เพิ่ม ลบ และแก้ไข
ตัวอย่างการใช้งาน Mysql
[thaiall@www thaiall]$ mysql -u username
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5 to server version: 3.22.32
Type 'help' for help.
mysql> status
mysql> show databases;
mysql> use test
mysql> show tables;
mysql> create table testf (
-> fld1 char(20),
-> fld2 char(20),
-> fld3 integer(3),
-> fld4 date );
mysql> select * from testf;
mysql> insert into testf (fld1, fld2, fld3)
-> values ('tom','dang',5 );
mysql> insert into testf (fld1, fld2, fld3) value ('siri','maru',19);
mysql> select * from testf;
+------+------+------+
| fld1 | fld2 | fld3 |
+------+------+------+
| tom | dang | 5 |
| siri | maru | 19 |
+------+------+------+
2 rows in set (0.00 sec)
mysql> exit
|