In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use navicat for mysql command line operation. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
1. Open Navicat
2. Click the "tools" menu and select "Command Line Interface".
3. Enter the mysql command line at this time
Extended data: MySQL basic operation command
Database operation
Show all databases
Mysql > show databases; (Note: there is an s at the end)
Create a database
Mysql > create database test
Connect to the database
Mysql > use test
View the database currently in use
Mysql > select database ()
Table information contained in the current database
Mysql > show tables; (Note: there is an s at the end)
Delete database
Mysql > drop database test
Table operation
Note: use "use" before operation to connect to a database.
Build a table
Command: create table ([,.. ])
Example:
Mysql > create table MyClass (> id int (4) not null primary key auto_increment, > name char (20) not null, > sex int (4) not null default '0mm, > degree double (16L2))
Get table structure
Command: desc table name, or show columns from table name
Example:
Mysql > describe MyClassmysql > desc MyClass;mysql > show columns from MyClass
Delete tabl
Command: drop table
For example: delete a table named MyClass
Mysql > drop table MyClass
Insert data
Command: insert into [[,.. ])] Values (value 1) [, (value n)]
Example:
Mysql > insert into MyClass values (1), (2), (2)
Query the data in the table
Query all rows
Mysql > select * from MyClass
Query the first few rows of data
For example: view the first two rows of data in table MyClass
Mysql > select * from MyClass order by id limit 0Pol 2
Or
Mysql > select * from MyClass limit 0Pol 2
Delete data from the table
Command: delete from table name where expression
For example: delete the record numbered 1 in table MyClass
Mysql > delete from MyClass where id=1
Modify the data in the table
Command: update table name set field = new value,... Where condition
Mysql > update MyClass set name='Mary' where id=1
Add fields to the table
Command: alter table table name add field type other
For example, a field passtest is added to the table MyClass, with a type of int (4) and a default value of 0
Mysql > alter table MyClass add passtest int (4) default'0'
Change the table name
Command: rename table original table name to new table name
For example: change the name of MyClass to YouClass in the table
Mysql > rename table MyClass to YouClass
Update field content
Command: update table name set field name = new content
Update table name set field name = replace (field name, 'old content', 'new content')
For example, add 4 spaces in front of the article
Update article set content=concat (', content); on how to use navicat for mysql command line operations to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.