mysql

sudo yum install mysql

sudo yum install mysql-server

sudo yum install mysql-devel

sudo service mysql start

sudo service mysql stop

sudo service mysql start

 

mysqladmin -u root password '123'

 

mysql -u root -p

 

1. SHOW database mysql> show databases

2. create database mysql> create database abccs

3. select database mysql> use abccs

4. show what tables mysql> show tables

5. create a tables mysql> create table mytable (name varchar(20), sex char(1), birth date, birthaddr varchar(20));

6. show the created tables mysql> show tables

7. show the table structure mysql> describe mytable

8. using select command to check table content mysql> select * from mytable

9. insert a record into table mysql> insert into mytable values (' abccs', ' f', '1974', 'china')

10. load txt file into table

set abccs f 1977-07-07 china 銆€ mary f 1978-12-12 usa tom m 1970-09-02 usa as  mysql.txt mysql> LOAD DATA LOCAL INFILE "mysql.txt" INTO TABLE mytable

11. show table mysql> select * from mytable

12. EXECUTE SCRIPT mysql> source *.sql

 

 

posted @ 2012-01-05 23:39  greencolor  阅读(247)  评论(0编辑  收藏  举报