Thao tác cơ bản Mysql

1 03 2008

1.Kết nối đến mysql
#mysql -u username -p
#password:
2.Thoát
#exit;
hoặc
#q;
3.Xác nhận code văn tự
#show variables like ‘char%’;
4.Tác thành Database
Biểu thị danh sách database:
#show databases;
Tạo database:
#create database ten_database;
ví dụ:
#create database cooking;
Để sử dụng database cooking:
#use cooking;
5.Tạo table
#create table ten_table(tên_field kiểu_field);
ví dụ:
#create table friends(no INT,name VARCHAR(30),birth DATE);
6.Xác nhận table
#show tables;


Actions

Information

Leave a comment