Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql basic command

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

End with a; sign or\ g

Show databases; / / show what databases are available

Use test; / / use + database name, enter the database

Show tables; / / display the tables in the library

Show tables from mysql; / / show tables from + library name, check the tables in the specified library, and do not leave the current library, or enter the show by use in the first two ways

Select database (); / / check which library currently resides

Create a table:

Create table hellowrold (/ / create table followed by the table name id int, / / other column names and other column names, separated by the sign name varchar (20)); / / varchar (20); string type with length 20

Desc hellowrold; / / desc + Table name displays detailed data such as the frame of the table

Select (asterisk) from hellowrold; / / select from + table name to view the data in the table

Insert into hello (id,name) values (1, "me"); / / insert data into the header, insert into + table name (column name, column name) values (assignment, assignment)

Update hello set address= "she" where id=1; / / modify the name of the address column corresponding to id=1 to

She, updata + table name + set+ column name = "assignment" + where+ another column name = the value for another column name

Delete from hello where id = 1; / / Delete the row in the hello table where the id column value is 1, delete from+

Header + where + column name = value

Select version (); / / View the current database version

Exit mysql first and then enter mysql-V / / without semicolons, which is equivalent to the dos command to view the database version.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report