Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 sql authentication script help

Author  Topic 

eric6630
Starting Member

1 Post

Posted - 2011-09-13 : 22:18:40
quote:
#!/bin/bash
### Database Informations
DBUSER='user'
DBPASS='pass'
DBHOST='x.x.x.x'
DBNAME='dbase'

user_name=`head -n1 $1 | tail -1` #first line -> Username
pass_word=`head -n2 $1 | tail -1 ` #second line -> Password

user_query=`mysql -u $DBUSER -p$DBPASS -D $DBNAME -h $DBHOST --skip-column-name -e "SELECT databasetable FROM databasename WHERE ( (active = '1') AND (username = '$user_name') AND (password = ('$pass_word')) );" $DBNAME`

if [ "$user_query" == "$user_name" ]; then
exit 0
else
exit 1
fi


hi

can anyone revise this script?
i need to authentication via remote server but this script doesn't work out

please help me

thank you

im using cent OS with mysql-server and phpmyadmin

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-09-13 : 23:21:21
eric, you've posted your question on a site that specializes in Microsoft SQL Server. You'll get better help if you post on a site that deals with the technologies you are using.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -