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

Several commands commonly used in mysql

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Query class

Show databases;-View all database names

Show tables;-to view all the data table names of the current database, you need to use the database first

Create database database name;-- create a database

Create table Datasheet name;-- create Datasheet

Select * from data table name;-- query all the contents of the data table.

Show create table "Table name"-the character set used when querying data tables to build tables

Show variable like "% char%";-- query the character set currently used by mysql

Desc table name;-- View the structure of the table.

Modify CLA

Alter table "table name" modify column field name "char (10);-- change the data type of a field in the data table

Insert into "Table name" (Field 1) [, Field 2],...] Values ("content 1" [, "content 2"]...])

Set names "character set"-set mysql default character set, re-use view

Create database "new database name" CHARACTER "character set";-- specify the character set when creating a new database

Alter table "Table name" default character set "character set"-change the character set used by the data table

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