Grant Priviledge For A User To A Database Via Bash Scripting

Jun 4, 2007

I tried grant a user to have access to a database via a shell script.

Database 'userdb' and user 'user1' are already setup.

This is my code .

Code:
#!/bin/sh

mysql -u root -pROOTPASS <<!
grant all privileges on userdb.* to user1@localhost
identified by 'dbpasswd' with grant option;
!
The code doesn't work.

View 11 Replies


ADVERTISEMENT

Linux BASH Scripting

Dec 7, 2008

I am currently trying to create a bash script which I will run off a loop with a sleep interval that will query tcpdump (udp packets only) on a network interface, and is looking for length 10 packets.

So far so good, not that hard to code I know (Already made it / coded it this far perfectly). Now here is the tricky part, I only want the bash script to identify IP's that have sent over 15 packets with the length of 10. (This is the part that I can't seem to find a way to code).

I was thinking, from the output maybe to calculate the number of lines with the same equal IP's.

Once this script identifies that, it will automatically run a command which I have set. (Quite easy, and I can do this).

I am looking for someone to help me with this. It is a fairly simple and quick job (editing the script I have at the moment). I am willing to also pay (if needed) an amount for this to be completed too. Obvieusly not that much, but still something I am sure we can work out.

View 2 Replies View Related

Bash Scripting :: Inode And Directory Size Counter

Apr 4, 2009

I'm writing an inode and directory size counter, but hit a snag with directories that contain a space.

Simple code, finds all directories within a folder, sets the current directory:

for i in `find . -type d`; do ls $i; done

Looks correct? It works great, until you hit directories with spaces. So I try the following methods:

for i in `find . -type d|sed 's/ / /g'`; do ls $i; done
for i in `find . -type d|sed 's/ / /g'`; do ls "$i"; done

What is happening is, at the ( for i in ), it treats each item at the first break, if its
or a ' '. Is there a flag I can set to make it only use
? When I pipe the data, it sends each chunk of the directory through.

[root@home /home/mindbend/dev_html]# for i in `find . -type d|sed 's/ / /g'`; do ls $i; done

ls: ./test: No such file or directory
ls: ing: No such file or directory
ls: 12: No such file or directory
ls: 3: No such file or directory
ls: ./test: No such file or directory
ls: ing: No such file or directory
ls: 12: No such file or directory
ls: 3/test: No such file or directory
ls: 2: No such file or directory

# ls -d test ing 12 3/
test ing 12 3/

#ls -d test ing 12 3/test 2/
test ing 12 3/test 2/

GNU bash, version 3.2.39(1)-release (i386-portbld-freebsd7.1)
Copyright (C) 2007 Free Software Foundation, Inc.

Issue exists on linux and freebsd, same code.

View 3 Replies View Related

Plesk 12.x / Windows :: Grant ALTER DATABASE Permission To All Microsoft SQL Server Users

Jun 19, 2014

In Plesk 12.0.18 #4 I checked Grant the ALTER DATABASE permission to all Microsoft SQL Server database users . The problem is I cannot rename database tables or other functions with myLittleAdmin for SQL provided with Plesk.

My question is: Am I doing something wrong or is needed to upgrade the myLittleAdmin license to Full version?

View 2 Replies View Related

Grant Networks Any Reviews

Jan 4, 2009

I tried to search as i have seen there plans are cheap.

View 0 Replies View Related

Clients Are Not Able To Add User To Database

Apr 12, 2008

Im a webhoster...im getting many support tickets that clients r not able to add user to the database in cpanel...

View 7 Replies View Related

How Would You Link User Genrated Pages To A Database

Jun 23, 2008

Lets say i gave user space on my site. They also make there own pages e.g blog or whatver

how would that work. Would those blog pages just automatically get added to my host server as if i uplaoded it

or would it get stored in a databse. if so how. and wer can i laern do u knw?

View 3 Replies View Related

1and1.com User Database Compromised, Sites Hacked

Jun 19, 2008

Even worse, they didn't even notice until I called. If you're a 1and1.com customer I recommend you change your username and password now!

I included some log snippets to help you make sure your account hasn't been compromised.

1and1.com hacked

View 6 Replies View Related

Plesk 11.x / Linux :: Make New User And Give 1 Database Only

Apr 14, 2015

1 have to create a new user, for example "webmaster" with ftp access, plesk access and database access.

My problem is: after i make all, this user can see all database for this domain. Can i show him only 1 database (him database)? If yes, how i can do?

View 2 Replies View Related

Plesk 12.x / Linux :: No Such User In Mail Authorization Database

Aug 4, 2014

After upgrading to plesk 12 over the weekend. None of my mail users can authenticate.I'm receiving quite a few error messages such as this for my ipmap users

authpsa[3822]: No such user 'bstewart@mwfbooks.com' in mail authorization database
courier-imapd: LOGIN FAILED, user=bstewart@mwfbooks.com, ip=[::ffff:69.176.116.106]

I've tried running mchk --with-spam command. But it hangs at the mail_auth_dump for several hours. Checking the cpu on that command and it is sitting idle.I've tried running the mail_auth_dump.worker manually and no better luck. Still nothing on the screen just hangs as if it's asleep.

View 3 Replies View Related

Plesk 12.x / Linux :: Unable To Create New Database User

Jun 22, 2015

Connection to the database server failed: Unknown column 'plugin' in 'mysql.user'

View 1 Replies View Related

Cross Scripting Attack

May 10, 2009

On IIS6 many of thesite are under cross scripting attack I tried by remove the the code but it affects again after some time I reset the ftp password and passowrd is a combination of complex alpna numeric character.I have cheked the permission it is ok.

How you guys fight with cross dcripting attack.

View 9 Replies View Related

Servage With Perl Scripting

Dec 1, 2008

I've used Servage for about 18 months. For most of that time there have been no problems. Then they decided to upgrade the cluster. This happened 3 weeks ago. Since then, there has been a catalogue of problems, mostly centred around a Perl script my site uses to implement a wiki.

The first problem was that they had removed four of the supporting Perl modules used by my Perl script. All of the missing modules are ones you would expect to find on any server that claims to support Perl. They had warned that this might happen (obviously too difficult for them to make sure that the upgraded server has all the Perl modules) so I notified them with a list of missing modules expecting the modules to be restored quickly. It actually took 1 week, during which time their support team tried their best to annoy me by giving responses related to PHP (apparently they'd managed to kill PHP scripting completely) and a non-working link to a list of installed modules (I knew what was installed already).

Having now got the script running, I hit a further problem. Prior to the upgrade the script had run under the "webserver" account. It was now running under the "you" account. This meant it couldn't write to its own data files. I had real trouble getting Servage to understand this one, let alone fix it. Most of their answers were about how to change the ownership of my script, which makes absolutely no difference to the problem. Eventually, after 4 days, they tried to fix the problem. The result was that my website became completely inaccessible. Even the static content was giving a 403 error. Again, it took support a while to understand the problem and about 1.5 days to fix it.

At this point Servage claimed to have fixed all outstanding issues. However, my script was still running under the wrong account. In frustration, I changed the ownership of all the script's data files to "you", which at least got my wiki running again.

However, I now find that people can't upload images to the site. Any attempt to do so produces an error "CGI open of tmpfile: Permission denied".

I've given up. I think my chances of getting Servage to even understand the problem are minimal. I'm not even going to try. I will be moving to another host as soon as possible - probably a VPS. That way I should be able to fix most problems myself.

View 14 Replies View Related

ASP Scripting On Linux Server

Oct 1, 2007

I have my site in asp scripting but it was suspended yesterday because of high resource usage on shared server. Thats why am looking for VPS, though it is difficult to find a good windows VPS, so i have decided to get a Linux VPS. But am confused that whether a linux vps will meet my requirement.

My site is using asp scripting with access databases on backend. I can host my access databases on a windows server and can provide the link in connection string. So, will webserver on a linux server be able to execute my asp scripting fine as IIS do on windows server.

Also i have music section that plays file in .wma format using windows media player, as i have used embedded object for windows media player. So there must be windows media player installed on linux server.

whether it is good decision to host site on linux server and will my objective be met in this case.

View 6 Replies View Related

PHP Scripting And Permissions On Unix

Dec 26, 2007

I currently have a script with code below that works great when the permissions on the dbconnect.php file are 755. The problem with this is that anyone on the web can see this config file which contains passwords DOH! If I change it to 751, then it tells me "cannot connect". The user and group on both the page and this script are the same.

With apache, i use the setting to store http and https files in the same directory.

Any ideas how to make this a little more secure? Changing the permission to 751 would do the trick but then it breaks the script. I don't understand why the script would be running taking "other" permissions into account...it should be running with "user" permissions instead. it might even have something to do with who the apache executable is running as...

<?php

include("../../../cgi-bin/dbconnect.php");

// Connect to server and select database.
mysql_connect("$databasehost", "$dbuser", "$dbpword")or die("cannot connect");
mysql_select_db("$dbname")or die("cannot select DB");

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved