首先需要安装MYSQL数据,不知你的是哪个发行版,就当是常用的吧,一般为
#apt-get install mysql-server mysql-client #for debian ubuntu
#yum install mysql-server mysql-client #for CENTOS RHEL
安装完毕后进入数据库
mysql 回车,一般在本机上直接用此命令就可以进入的,从其它机器连接还需要账号密码
mysql>source <filename> #把<filename>换成你要导入的数据库备份SQL文件完整路径,回车等待
mysql>exit #打完收功,退出MYSQL
您好,很高兴为您解答:
isql -Uusername -Ppassword
进入后选择数据库:
use database
go
执行sql语句,例如:
select from tablename
go
如果有SQL文件,可以直接执行 isql -Uusername -Ppassword -ifilenamesql
转载,仅供参考。希望以上信息可以帮到您!
DB2数据库命令简介 1.启动数据库 DB2start 2.停止数据库 DB2stop DB2数据库在linux相关指令之3.连接数据库 DB2 connect to o_yd user DB2 using pwd 4.读数据库管理程序配置 DB2 get dbm cfg 5.写数据库管理程序配置 DB2 update dbm cfg using 参数名 参数值 6.读数据库的配置 DB2 connect to o_yd user DB2 using pwd DB2 get db cfg for o_yd 7.写数据库的配置 DB2 connect to o_yd user DB2 using pwd DB2 update db cfg for o_yd using 参数名 参数值 8.关闭所有应用连接 DB2 force application all DB2 force application ID1,ID2,,,Idn MODE ASYNC (DB2 list application for db o_yd show detail) 9.备份数据库 DB2 force application all DB2 backup db o_yd to d: (DB2 initialize tape on \tape0) (DB2 rewind tape on \tape0) DB2 backup db o_yd to \tape0 10.恢复数据库 DB2 restore db o_yd from d: to d: DB2 restore db o_yd from \tape0 to d: DB2数据库在linux相关指令之11.绑定存储过程 DB2 connect to o_yd user DB2 using pwd DB2 bind c:dfplusbnd 拷贝存储过程到服务器上的C:sqllibfunction目录中 12.整理表 DB2 connect to o_yd user DB2 using pwd DB2 reorg table ydd DB2 runstats on table ydd with distribution and indexes all 13.导出表数据 DB2 export to c:dftztxt of del select from dftz DB2 export to c:dftzixf of ixf select from dftz 14.导入表数据 import from c:123txt of del insert into ylbxczyxx DB2 import to c:dftztxt of del commitcount 5000 messages c:dftzmsg insert into dftz DB2 import to c:dftzixf of ixf commitcount 5000 messages c:dftzmsg insert into dftz DB2 import to c:dftzixf of ixf commitcount 5000 insert into dftz DB2 import to c:dftzixf of ixf commitcount 5000 insert_update into dftz DB2 import to c:dftzixf of ixf commitcount 5000 replace into dftz DB2 import to c:dftzixf of ixf commitcount 5000 create into dftz (仅IXF) DB2 import to c:dftzixf of ixf commitcount 5000 replace_create into dftz (仅IXF) 15.执行一个批处理文件 DB2 -tf 批处理文件名 (文件中每一条命令用 ;结束) 16.自动生成批处理文件 建文本文件:tempsql select 'runstats on table DB2' || tabname || ' with distribution and detailed indexes all;' from syscattables where tabschema='DB2' and type='T'; DB2 -tf tempsql>runstatssql 17.自动生成建表(视图)语句 在服务器上:C:sqllibmisc目录中 DB2 connect to o_yd user DB2 using pwd DB2look -d o_yd -u DB2 -e -p -c c:o_ydtxt DB2数据库在linux相关指令之18.其他命令 grant dbadm on database to user bb 19select from czyxx fetch first 1 rows only 20DB2look -d ylbx -u DB2admin -w -asd -a -e -o atxt21 显示当前用户所有表 list tables 22列出所有的系统表 list tables for system 23查看表结构 DB2 describe select from usertables (实习编辑:HJ)
Linux登录MySQL数据库的命令就是mysql(注意命令的字母全部都是小写字母),这个命令实际上是一个MySQL客户端程序,所以需要安装这个MySQL客户端才会有这个命令:
apt-get install mysql-client
su - oracle
sqlplus /nolog
connect /as sysdba
详细步骤:
oracle数据库是目前最流行的服务器数据库之一,能够事项分布式处理功能,那么Linux服务器要如何启动oracle数据库呢?下面小编就给大家介绍下Linux使用命令启动oracle数据库的步骤,一起来了解下吧。
首先使用oracle用户登录Linux,然后在shell命令行中执行下面的命令:
第一步:打开Oracle监听
$ lsnrctl start
第二步:进入sqlplus
$ sqlplus /nolog
SQL》
第三步:使用sysdab角色登录sqlplus
SQL》 conn /as sysdba
第四步:启动数据库
SQL》 startup
以上就是关于如何在LINUX下建立一个MYSQL数据库,然后我想把一个SQL数据库导入进去,求步骤!全部的内容,包括:如何在LINUX下建立一个MYSQL数据库,然后我想把一个SQL数据库导入进去,求步骤!、知道在LINUX终端上进入SYBASE数据库并进行 *** 作的命令吗、DB2数据库在linux *** 作系统的指令有哪些等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)