Basic operation of Mysql based on Linux operating system (ii)
Let's start by creating a library with the following steps:
#create database Wu;
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/8E/97/wKioL1jGW_ORAwqXAAAJEtICOtY994.png-wh_500x0-wm_ 3-wmp_4-s_3011650503.png "title=" 99.PNG "alt=" Wkiol1jgw_orawqxaaajeticoty994.png-wh_50 "/>
#show databases;
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8E/99/wKiom1jGXEDBUikkAAAQNcz2ch8554.png-wh_500x0-wm_ 3-wmp_4-s_973247348.png "title=" 100.PNG "alt=" Wkiom1jgxedbuikkaaaqncz2ch8554.png-wh_50 "/>
#use Wu;
# CREATE TABLE test (ID int (3), name char (10));
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/8E/97/wKioL1jGXHPgjzSaAAAKOps3h-8698.png-wh_500x0-wm_ 3-wmp_4-s_950398477.png "title=" 101.PNG "alt=" Wkiol1jgxhpgjzsaaaakops3h-8698.png-wh_50 "/>
to create a table format: Create table table name (table column name 1 data type, table column name 2 data type . ..... )
#show CREATE TABLE test;
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M02/8E/99/wKiom1jGXLPyjT0NAAAdAcODK3A668.png-wh_500x0-wm_ 3-wmp_4-s_1578020786.png "title=" 102.PNG "alt=" Wkiom1jgxlpyjt0naaadacodk3a668.png-wh_50 "/>
# INSERT INTO test values (1,teng);
# SELECT * FROM test;
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/8E/99/wKiom1jGXPbBXAUYAAAX43Nf3dM311.png-wh_500x0-wm_ 3-wmp_4-s_3986080035.png "title=" 103.PNG "alt=" Wkiom1jgxpbbxauyaaax43nf3dm311.png-wh_50 "/>
Add only one content, command:
# INSERT INTO Test (ID) values (2);
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8E/99/wKiom1jGXWuRo9_pAAAUtlTe_II950.png-wh_500x0-wm_ 3-wmp_4-s_2605407202.png "title=" 104.PNG "alt=" Wkiom1jgxwuro9_paaautlte_ii950.png-wh_50 "/>
# Update test set name= ' Fei ' where id=2;
# SELECT * FROM test;
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8E/99/wKiom1jGXaCjiz81AAAZI1pwXqk167.png-wh_500x0-wm_ 3-wmp_4-s_504238218.png "title=" 105.PNG "alt=" Wkiom1jgxacjiz81aaazi1pwxqk167.png-wh_50 "/>
# Delete from test where id=2;
# SELECT * FROM test;
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M02/8E/99/wKiom1jGXc-ys76rAAATJdI9lMQ747.png-wh_500x0-wm_ 3-wmp_4-s_2020147199.png "title=" 106.PNG "alt=" Wkiom1jgxc-ys76raaatjdi9lmq747.png-wh_50 "/>
#truncate table test;
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/8E/99/wKiom1jGXfTxEyBTAAANavOAfng203.png-wh_500x0-wm_ 3-wmp_4-s_3433495645.png "title=" 107.PNG "alt=" Wkiom1jgxftxeybtaaanavoafng203.png-wh_50 "/>
#drop table test;
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/8E/97/wKioL1jGXiTQdmiFAAAQoaow1Lc869.png-wh_500x0-wm_ 3-wmp_4-s_3660270887.png "title=" 108.PNG "alt=" Wkiol1jgxitqdmifaaaqoaow1lc869.png-wh_50 "/>
#drop databases Wu;
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/8E/97/wKioL1jGXlCAW-OIAAA0Mc61LlA517.png-wh_500x0-wm_ 3-wmp_4-s_2295862090.png "title=" 109.PNG "alt=" Wkiol1jgxlcaw-oiaaa0mc61lla517.png-wh_50 "/>
Note: When deleting the library and updating, the data remember to back up!
This article is from the "Wu Fei" blog, please be sure to keep this source http://wutengfei.blog.51cto.com/10942117/1905963
Basic operation of MySQL based on Linux operating system (ii)