mysql> create database d-d; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-d' at line 1 1064报错:该错误一般出现在表名或者字段名设计过程中出现了mysql关键字导致的.问题确定是数据库名字的…
The difference between "-" and "no hyphen" is that the latter keeps your existing environment (variables, etc); the former creates a new environment (with the settings of the actual user, not your own). 带横杠的会创建一个全新的环境,使用的是真实用户的设置. 不带横杠…
一.管理 mongodb 数据库:mongo 查看所有数据库列 表 show dbs 二. 创建数据库 创建 数据库 use student 如果真的想把这个数据库创建成功,(collections)中插入数 据.不需要专门创建集合,只db.student 系统发现 是一个陌生的集合名字,所以就显示当前的数据集合(中叫表)删除集合,删除指定的集合 三. 查询数据 1.查询所有记 录 db.userInfo.find(); 相当于:select* from userInfo; 2.查询去掉后的当前…
方法1 - 系统命令 sudo su - postgres #切换到postgres用户(系统用户) createdb weichen #创建数据库 psql #直接訪问数据库(默认进入本地postgres数据库) \l --查看数据库列表 :q --退出列表页面 \q --退出client dropdb weichen #删除数据库 方法2 - psql命令行 sudo -u postgres psql #登录client create database weichen; --创建数据库 cr…
在MongoDB数据库里面是存在有数据库的概念,但是没有模式(所有的信息都是按照文档保存的),保存数据的结构就是JSON结构,只不过在进行一些数据处理的时候才会使用到MongoDB自己的一些操作符号 查看该数据库服务器中所有的数据库 使用和创建数据库 use mydb  //没有就创建,实际上这个时候并不会创建数据库,只有在数据库里面保存集合数据之后才能够真正创建数据库 use mydb //没有就创建 显示数据库 show dbs 显示数据库状态 db.stats() 检查当前所用的数据库 d…
使用数据库.创建数据库 use student 如果真的想把这个数据库创建成功,那么必须插入一个数据. 数据库中不能直接插入数据,只能往集合(collections)中插入数据.不需要专门创建集合,只 需要写点语法插入数据就会创建集合 插入数据: db.student.insert({"name":"xiaoming"} 查询所有记录: db.userInfo.find(); /*相当于:select* from userInfo;*/ 查询去掉后的当前聚集集合中的…
小测试: [root@test test]# ls [root@test test]# touch -abc touch: invalid option -- 'b' Try `touch --help' for more information. [root@test test]# touch -m touch: missing file operand Try `touch --help' for more information. [root@test test]# mkdir --hel…
登录mysql服务器后可使用grant命令来创建用户并赋予相关权限. mysql> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,D…
创建表 语法:  #进入数据库 mysql> use mydb123; Database changedmysql> select database();+------------+| database() |+------------+| mydb123 |+------------+1 row in set (0.00 sec) #创建一个名为test的表 mysql> create table test( -> id int, -> name varchar(20) -…
创建.删除唯一约束: db2 "alter table tabname add unique(colname)" db2 "alter table tabname drop unique CONSTNAME " 创建主键约束: db2 "alter table staff add primary key (id)" db2 "alter table t_da_jkda_rkxzl drop primary key"…