Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Connect MySQL database from Unix Post 302406942 by apsprabhu on Wednesday 24th of March 2010 08:16:45 AM
Old 03-24-2010
Thanks a lot Durden...

As i'm new to mysql , Please clarify me on the following,


Code:
$ cat -n connect_mysql.sh
     1 #!/bin/bash
     2 # connect to test database and query the EMP table
     3 mysql -u test -ptest test <<EOF
     4 select * from emp;
     5 EOF


mysql -u test -ptest test
---> here what does the "-u" do?
---> here which is the user name?
--->here which is the database name?
---> here why the "test" comes twice?

Last edited by pludi; 03-24-2010 at 09:26 AM.. Reason: code tags, please...
 

8 More Discussions You Might Find Interesting

1. Programming

¿how can I connect C to a database?

hi, please, help me i need connect my program in C whit a SybaseIQ 12 database i´m programming in solaris 5 (unix) please, help me, because i don`t know what to do... thanks.. jonathan (0 Replies)
Discussion started by: DebianJ
0 Replies

2. Shell Programming and Scripting

Can i connect from a .sh or .sc to a database?

please, help me-.... i need connect to a database Sybase IQ 12 and I don't know if i can do it using a shell program. if it's posibble, please tell me how... please, help me, because I don't know what to do.... thanks... jonathan (1 Reply)
Discussion started by: DebianJ
1 Replies

3. Shell Programming and Scripting

How to connect to database db2 through Unix Shell Script

I am trying to connect to database db2 through shell script. The process I am trying is > db2 It gives me error Access Denied. While checking for access I have the rights. Is there ant other way round..? Please help. (3 Replies)
Discussion started by: ankitgupta
3 Replies

4. Shell Programming and Scripting

how will i connect postgres database from unix shell script

I have got the solution so just closing this issue. (3 Replies)
Discussion started by: jambesh
3 Replies

5. Shell Programming and Scripting

How to COnnect to Oracle database from UNIX Box

I am trying to connect to Oracle Databse from UNIX box using sqlplus command. But i get sqplus not found message. $ sqlplus sqlplus: not found I have searched in forums and all are suggesting to set environment varaibles...can somebody tell me what variables to set and how to set.and the... (12 Replies)
Discussion started by: angelarosh
12 Replies

6. Shell Programming and Scripting

How to connect with oracle database using unix...

Hi all I am working in datawarehouse project and use DB2 database . shell scripting is written to connect with DB2 database in my application but i dont know how to connect with oracle databse or other databases.Is there any command in unix to connect any of these datbases? (6 Replies)
Discussion started by: vijays3
6 Replies

7. Shell Programming and Scripting

Connect to database from different unix box

Hi Friends, I have a one unix box "x.y.z" on SunOS , where oracle is not installed. And another machine "a.b.c" on AIX , where oracle is installed. Now i want to make a script on x.y.z , that can connect to database on a.b.c, using sqlplus command. and then generate a report based on the... (5 Replies)
Discussion started by: gauravgarg
5 Replies

8. UNIX for Dummies Questions & Answers

MySQL Database Missing on UNIX server. Possible to recover?

My dedicated server is VERY old (running Apache/1.3.37 (Unix) PHP/4.4.4 FrontPage/5.0.2.2510). We have a script that runs and manages our customer database. Early in the morning last Friday, it was working fine and processed data as usual. Later in the day, we got this error: Cannot... (2 Replies)
Discussion started by: SurfMe69
2 Replies
zap(1)								  MySQL database							    zap(1)

NAME
zap - a perl script used to kill processes USAGE
/usr/bin/mysql_zap [-signal] [-?Ift] pattern SYNOPSIS
zap [-I|-?] [-f] [-t] DESCRIPTION
zap supports by executing -I|-? info -f force -t test NOTE
If -f isn't given, ask user for confirmation for each process to kill. If signal isn't given, try first with signal 15 and after that with signal 9. If -t is given the processes is only shown on stdout. SEE ALSO
isamchk(1), isamlog(1), mysql(1), mysqlaccess(1), mysqladmin(1), mysqld(1), mysqld_multi(1), mysqld_safe(1), mysqldump(1), mysql_fix_privi- lege_tables(1), mysqlshow(1), perror(1), replace(1) For more information please refer to the MySQL reference manual, which may already be installed locally and which is also available online at http://www.mysql.com/doc/en/ BUGS
Please refer to http://bugs.mysql.com/ to report bugs. AUTHOR
Ver 1.0, distribution 4.0.24 Michael (Monty) Widenius (monty@mysql.com), MySQL AB (http://www.mysql.com/). This software comes with no war- ranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurme- dia.com) ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+------------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+------------------------------------+ |Availability | SUNWmysqlr, SUNWmysqlu, SUNWmysqlt | +--------------------+------------------------------------+ |Interface Stability | External | +--------------------+------------------------------------+ NOTES
Source for mysql is available on http://opensolaris.org. MySQL 4.0 19 December 2000 zap(1)
All times are GMT -4. The time now is 06:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy