navicat中mysql 命令行_如何使用navicat进行mysql命令行操作?

如何使用navicat进行mysql命令行操作?,命令,数据库,字段名,字段,操作

如何使用navicat进行mysql命令行操作?

易采站长站,站长之家为您整理了如何使用navicat进行mysql命令行操作?的相关内容。

8951855f7e8b7235441834c637323d64.png

下面介绍如何使用Navicat进行mysql命令行操作的具体操作方法。

1、打开Navicat

a42084e6544a8c80373b39d26ac8c52c.png

2、点击【工具】菜单,选择【命令列界面】

80742dd59edbd1573142362052ae03f8.png

3、此时进入了mysql命令行状态

57a06c776f8bd76c8b7aae159f1d509a.png

扩展资料:MySQL基本操作命令

数据库操作

显示所有的数据库mysql> show databases;(注意:最后有个 s)

创建数据库mysql> create database test;

连接数据库mysql> use test;

查看当前使用的数据库mysql> select database();

当前数据库包含的表信息mysql> show tables; (注意:最后有个 s)

删除数据库mysql> drop database test;

表操作

备注:操作之前使用“use ”应连接某个数据库。

建表

命令:create table ( [,.. ]);

例子:mysql> create table MyClass(> id int(4) not null primary key auto_increment,> name char(20) not null,> sex int(4) not null default '0',> degree double(16,2));

获取表结构

命令: desc 表名,或者show columns from 表名

例子:mysql> describe MyClassmysql> desc MyClass;mysql> show columns from MyClass;

删除表

命令:drop table

例如:删除表名为 MyClass 的表mysql> drop table MyClass;

插入数据

命令:insert into [( [,.. ])] values ( 值 1 )[, ( 值 n )]

例子:mysql> insert into MyClass values(1,'Tom',96.45),(2,'Joan',82.99), (2,'Wang', 96.59);

查询表中的数据

查询所有行mysql> select * from MyClass;

查询前几行数据

例如:查看表 MyClass 中前 2 行数据mysql> select * from MyClass order by id limit 0,2;

或者mysql> select * from MyClass limit 0,2;

删除表中数据

命令:delete from 表名 where 表达式

例如:删除表 MyClass 中编号为 1 的记录mysql> delete from MyClass where id=1;

修改表中数据

命令:update 表名 set 字段=新值,... where 条件mysql> update MyClass set name='Mary' where id=1;

在表中增加字段

命令:alter table 表名 add 字段 类型 其他;

例如:在表 MyClass 中添加了一个字段 passtest,类型为 int(4),默认值为 0mysql> alter table MyClass add passtest int(4) default '0'

更改表名

命令:rename table 原表名 to 新表名;

例如:在表 MyClass 名字更改为 YouClassmysql> rename table MyClass to YouClass;

更新字段内容

命令:update 表名 set 字段名 = 新内容

update 表名 set 字段名 = replace(字段名, '旧内容', '新内容');

例如:文章前面加入 4 个空格update article set content=concat(' ', content);以上就是关于对如何使用navicat进行mysql命令行操作?的详细介绍。欢迎大家对如何使用navicat进行mysql命令行操作?内容提出宝贵意见

  • 2
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值