Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server
You last visited: Today at 16:01

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Mysql Query in a Shell file?

Discussion on Mysql Query in a Shell file? within the Metin2 Private Server forum part of the Metin2 category.

Reply
 
Old   #1
 
sema1995's Avatar
 
elite*gold: 0
Join Date: May 2011
Posts: 254
Received Thanks: 68
Mysql Query in a Shell file? Can Close, Solved.

Hello, i'm tryiing to use a query in a shell file but i not know the sintax, anyone can help me?

Here a example:
PHP Code:
#!/bin/sh
os.execute("mysql Update auktionhaus.auktionhaus_items SET tiempo = tiempo -3600 where tiempo > 3600")
But not work xd 
Thanks.
sema1995 is offline  
Old 08/15/2014, 17:45   #2
 
elite*gold: 0
Join Date: Sep 2013
Posts: 77
Received Thanks: 44
PHP Code:
!/bin/bash
mysql 
-u root -pPASSWORD<<EOF
Update auktionhaus
.auktionhaus_items SET tiempo tiempo -3600 where tiempo 3600;
EOF 
Damn' is offline  
Thanks
1 User
Old 08/15/2014, 18:11   #3
 
sema1995's Avatar
 
elite*gold: 0
Join Date: May 2011
Posts: 254
Received Thanks: 68
Quote:
Originally Posted by ****' View Post
PHP Code:
!/bin/bash
mysql 
-u root -pPASSWORD<<EOF
Update auktionhaus
.auktionhaus_items SET tiempo tiempo -3600 where tiempo 3600;
EOF 
Thanks for reply but..
Bash not found and i put now, !/bin/sh and...
sema1995 is offline  
Old 08/15/2014, 18:13   #4
 
elite*gold: 0
Join Date: Sep 2013
Posts: 77
Received Thanks: 44
you should enter -pPASSWORD to you password ^^
Damn' is offline  
Thanks
1 User
Old 08/15/2014, 18:23   #5
 
sema1995's Avatar
 
elite*gold: 0
Join Date: May 2011
Posts: 254
Received Thanks: 68
Quote:
Originally Posted by ****' View Post
you should enter -pPASSWORD to you password ^^
Yes, now i understand works fine, thanks
sema1995 is offline  
Old 08/16/2014, 08:11   #6

 
#dynastie's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 593
Received Thanks: 467
Use -e/--e Parameter. Better than EOF-methode.
#dynastie is offline  
Reply


Similar Threads Similar Threads
Kleine Frage an die MySQL-Profis ^^ || MySQL Query
05/27/2014 - Web Development - 7 Replies
Hallo, da ich gerade dabei bin ein Script für meine Webseite umzuschreiben und die Registration einfach nicht klappt, habe ich das Script mal auseinandergenommen und angeschaut. Bei der Registration macht das Script / die Query folgendes : Also Theoretisch:
PHP/MySQL Help - Is this MySQL Query correct?
09/23/2011 - CO2 Programming - 1 Replies
$rank = mysql_query("SELECT Name,Level,Class,Online FROM entities ORDER BY Level DESC LIMIT $limit"); I'm pretty sure that is right... whenever I do while ($row = mysql_fetch_array($rank)) { ... } It always gives me a mysql_fetch_array error. I've checked and the database is populated, the columns exist, so what could be the issue?
[Shell/Bash]MySQL BackUp Script
02/20/2011 - Web Development - 8 Replies
Hallo, ich möchte mir ein BackUp Script für MySQL schreiben. Das Packen des MySQL Ordners habe ich schon hinbekommen, leider habe ich da 2 Probleme. Dies hier Funktioniert, aber ich möchte ja halt noch die MySQL Tabelle leeren und somit zuerst eine Verbindung zum MySQL Server aufbauen. #!/bin/sh cd /var/db tar -czf "/var/db/BackUp/SQL_"`date +"%d.%m.%Y"`".tar.gz" "/var/db/mysql"



All times are GMT +1. The time now is 16:02.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.