1,非集群下 Windows环境下数据库
conn scott/123@127.0.0.1:1521/orcl
conn scott/123456@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =
(PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)))(CONNECT_DATA =
(SERVER = DEDICATED)(SERVICE_NAME = orcl)))
Linux环境下数据库
conn scott/123@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST
= 127.0.0.1)(PORT = 1521)))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME =
orcl)))
2,集群下连接
conn scott/123@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE = yes)(FAILOVER = on)
(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(ADDRESS=
(PROTOCOL=TCP)(HOST=127.0.0.2)(PORT=1521)))(CONNECT_DATA=(SERVER=default)
(SERVICE_NAME=orcl)))
扩展资料
在命令行中登录oracle数据库:
sqlplus username/password 如:普通用户登录 sqlplus scott/tiger
sqlplus username/password as sysdba 如:sqlplus sys/admin as sysdba
sqlplus username/password@net_service_name 如: sqlplus scott/tiger@orcl
sqlplus username/password@//host:port/sid
参考资料:百度百科 - Oracle数据库
1、连接到本机上的MYSQL命令行首先打开DOS窗口,然后进入目录mysql\bin,再键入命令mysql -u root -p,回车后提示你输密码.注意用户名前可以有空格也可以没有空格,但是如果-p后带有用户密码,那么-p与密码之间必须没有空格,否则让你重新输入密码.例如以下都是合法的登陆:(帐号:root 密码:123)
mysql -u root -p
mysql -uroot -p
mysql -uroot -p123
如果刚安装好MYSQL,超级用户root是没有密码的,故直接回车即可进入到MYSQL中了,MYSQL的提示符是: mysql>
2、连接到远程主机上的MYSQL命令行
假设远程主机的IP为:110.110.110.110,用户名为root,密码为abcd123。则键入以下命令:
mysql -h110.110.110.110 -u root -p 123(注:u与root之间可以不用加空格,其它也一样)
3、退出MYSQL命令: exit (回车)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)