Software :: Update Csv File Into Mysql Db Via Bash Script?

Jan 12, 2010

I have a csv file that has a upc code and a qty (inventory). I need to insert it into my mysql table, but the table has several columns including upc, qty, price, etc. point me in the right direction to getting this done? Hopefully I can have a handy script when I'm done and all I do is run that script. I just want to make sure we don't delete the description, price, etc stuff and only update qty, using the upc code as the identifier so that the right qty get's input into the table.

View 4 Replies


ADVERTISEMENT

General :: How To Update A File In Bash

Jan 26, 2011

how to update a file that is already exist in bash. so far i haven found any. I'm using parameter as my first start for the existent, copy file to a different directory.

View 5 Replies View Related

Ubuntu Servers :: Update DHCP Leased File To PowerDNS MySQL DB?

Mar 2, 2010

I setup PowerDNS for my local system following

[URL]

How can I update client info from DHCPd leased file to PDNS MySQL for lookup/reverse my network?

View 1 Replies View Related

Debian :: Get Mysql To Update From Lenny (mysql-5.0) To Squeeze (5.1)?

Aug 20, 2010

I can't get mysql to update from lenny (mysql-5.0) to squeeze (5.1). apt tries to start the server but comes up with some kind of configuration script error.

View 1 Replies View Related

OpenSUSE :: MySql Won't Start / No File Mysql.sock?

Feb 5, 2009

I thought that the problem is in the phpMyAdmin not in the mysql. But now i think different. It seems that the problem is right in the mysql. I think that there was no root user, when mysql was freshly installed. Unfortunately i did everything i can find on internet (some tutorials) but they don`t helped me at all, maybe i fu**ed up the mysql service. So i reinstalled it, and when i want to start it there is no file mysql.sock and i get the following:

linux-nepg:~ # service mysql restart
Restarting service MySQL
Shutting down service MySQL done
Starting service MySQL warning: /var/lib/mysql/mysql.sock didn't appear within 30 seconds

View 9 Replies View Related

General :: Bash Script To Read From MySQL?

Apr 20, 2009

I need a bash script that can read from a MySQL database field and insert the read information into a variable. I need it to read from a field in the database which will list if somone is using Linux or Windows. Once its done that the code will continue as follows:

Code:

if [ "$var" = "linux" ] ; then
OTHER CODE HERE
else

[code]....

View 1 Replies View Related

Server :: Does The Mysql User Need Bash Shell

Oct 2, 2010

Is there any reason for the mysql user to need bash shell?

From /etc/passwd:

Code:
mysql:x:100:103:MySQL server:/var/lib/mysql:/bin/bash

Will anything break if I change that to /bin/false?

View 2 Replies View Related

Server :: Get Variable From Bash From Mysql Or Pass From Php?

Apr 26, 2010

I am not parsing on a webserver so is it possible to have both

#! /usr/bin/php &
#!/bin/bash

in the same script? Alternatively, I have a current bash script that I need to get some variables from mysql and not sure how to get mysql results in bash:

Quote:

mysql -h server.net -u username1 -paaa -e "USE squid; SELECT email, usern FROM TABLE WHERE blah blah;"
emailadd="resultfrom above"
usern="resultfromabove"

View 11 Replies View Related

General :: Write A Literal Bash Command In A Bash File?

Nov 29, 2010

I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:

Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END

[code]...

View 6 Replies View Related

Programming :: Bash To Loop Through Mysql Select Array?

May 26, 2011

I need to know how to assign a result from a select. I am clueless on the sytax. I am trying this in bash. Maybe I am not assigning the array right. It gives me the whole row in the echo instead of just field a. How do I get fieldA = a in the select. Note script was stripped for security on database info but the syntax is same.

Code:

#!/bin/sh
results="$(mysql --user ${DB_USER} -p${DB_PWD} ${DB_NAME} -Bse 'select a,b,c,d from tblMytable')"
for rows in "${results[@]}"
do
fieldA=${rows[0]};
echo ${fieldA};
done

View 2 Replies View Related

Programming :: Looping Over Mysql Query Results In Bash?

Sep 15, 2010

I am querying a single string column in a table. The string values have spaces in them. I want to loop over each value in bash. I set IFS to split lists on newlines instead of spaces. When I try this, it is splitting the list of results on the actual character 'n', not the newline ''.

DATA=`mysql -u root -ppassword --silent 'SELECT name FROM table_a;'`
IFS=$'
'
for i in $DATA; do
echo "item = $i"

[Code]....

View 5 Replies View Related

Ubuntu :: Access MySQL-Workbench From Desktop Without Having To Tie Up My Bash Shell?

Aug 3, 2011

I just downloaded MySQL-Workbench and I see it in the folder: Code: /usr/bin how do I access it from my desktop without having to tie up my bash shell because the only way I can get to it right now is

Code:
cd /usr/bin
mysql-workbench

and only when I close the program can I use my bash for anything else.

View 7 Replies View Related

Programming :: Get A Password In A Bash Script For Mysql User Creation?

Apr 25, 2010

I'm trying to get a password in a bash script for mysql user creation. But sometimes a get a non-alphanumeric character(s) in the password, and mysql failes with that. I tryed with apg -EO0Il1`~!@#$%^&*()_+-=[];./{}|:"'<>? but failed. I tryed with sed 's/[^a-zA-Z2-9]//g' , but at that moment the minimum password lenght failed. I'm also fine when there is a better alternative then apg.

View 2 Replies View Related

Ubuntu Servers :: Su As Backup User Inside Of Bash Script - Lock And Flush Tables On A Mysql Db

Jan 23, 2010

I am attempting to write a backup script that will do the following:

1) lock and flush tables on a mysql db
2) dump the db to a file
3) unlock the tables
4) rsync the file to offsite storage

It all seems to be going well. However, obviously I don't want to setup ssh to the storage server on another network as the root user without a password. so I am attempting to su as the backup user inside of the script but when I try to run the script everything happens as it should until I try to so.. then it jumps out of the script .. akss me to login as the backup user.. proceeds to rsync to the offsite storage it does all this and then resumes execiting the script. it is not going to be setup as a cron job. it will be executed manually. assuming that is the case, how can I get the script to run without prompting for a password?

Here is what I've come up with so far... assuming that the script is run as root and the identity of the backup user will need to be assumed inside the script without perstering the user to enter the backup user's password.

[Code]....

View 8 Replies View Related

OpenSUSE Network :: ERROR 2002 (HY000): Can't Connect To Local MySQL Server Through Socket '/var/mysql/mysql.sock

Jun 7, 2011

I think this goes here, but I'm not sure. I decided that XAMPP had been troublesome enough. MySQL never worked. So I decided to instal the LAMP stack offered by YaST. I went about installing it thinking that it would all work. But it seems that I was wrong. So I try to start mysql, and here's what I get:

Code:
the-matrix:~ # mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) or
Code:
the-matrix:~ # rcmysql start
Starting service MySQL warning: /var/mysql/mysql.sock didn't appear within 30 seconds
chmod: cannot access `/var/run/mysql/mysqld.pid': No such file or directory

[Code]...

View 6 Replies View Related

General :: Can't Connect To Local MySQL Server Through Socket '/var/lib/mysql/mysql.sock' (2)

Jun 2, 2010

i am using liferay5.2(mysql included in the download pack) on fedora. while liferay is working fine but i cannot connect to mysql.i am getting the error

[
[root@localhost ~]# ln -s /var/lib/mysql/mysql.sock /tmp
[root@localhost ~]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.

[code]....

i didnt find the mysql.sock file in the location /var/lib/mysql/mysql.sock. i cannot find the portal-ext.properties file also to make intial settings.

View 9 Replies View Related

OpenSUSE :: MySQL Workbench Update On 11.3?

Oct 30, 2010

I'm running OpenSuse 11.3 which comes with MySQL Workbench V 5.12.16-8.2. This version hangs on connections and has several other behavior problems that others have reported. For several reasons, I need 5.2+ . As a relatively new regular user of OpenSuse, I've learned that it's much better for me if I work within the package environment (read: I've made mistakes and am willing to learn) so I'm reluctant to try to just load the Suse rpm off the MySQL.org site. So:is there a more recent release of Workbench in a repository I've not found yet? if not, what's the safest way to install this as an rpm that will not impact the rest of the package management system?

View 6 Replies View Related

General :: Update Mysql Database From 5.0 For 5.1?

Sep 5, 2010

i need to update my mysql database from 5.0 for 5.1, i have several java application and php application running on that server, without disturbing the setup i need to upgrade the server can someone suggest a method of doing this

View 2 Replies View Related

Server :: Cannot Start MySQL After Update

Jun 14, 2010

I cant start mysql of my server after the update. my operating system is centos. I get this error.
MySQL Daemon failed to start.
Starting MySQL: [FAILED]

View 4 Replies View Related

Software :: Update Part Of A URL To Another URL In MySQL?

Feb 15, 2009

I have about 5k of data i need to update.. this in my current database:

[URL]

I want to change it to this:

[URL]

So basically, I want to change only part of the URL, not the entire URL.. is there a way to do this? so only this part of the first url:

[URL]

to

[URL]

View 2 Replies View Related

CentOS 5 :: Update PHP To 5.3.8 But Stay On MySQL 5.1?

Aug 31, 2011

I wish to update a CentOS 5.6 system to PHP 5.3.8, but keep the MySQL version at 5.1.

I am using these repos (in addition to the stock CentOS repos):

epel
rpmforge
remi

At present, the system has php-5.3.5-1.el5.remi.1 and mysql-5.1.53-1.el5.remi.

When I attempt to 'yum update php' it automatically wants to update mysql to v5.5. If I explicitly exclude mysql either on the yum command line or in the remi repo config file, it produces depsolving errors.

Where may I find a set of PHP 5.3.8 RPMs which are NOT dependency bound to an upgrade of MySQL from v5.1?

View 1 Replies View Related

Ubuntu :: No UPnP Message After MySQL Update?

Jul 26, 2010

I just ran some system updates today. MySQL was among them. after rebooting. I got a message I haven't seen since I was first installing several months ago. I couldn't connect to the database.

At first, I freaked out because I didn't know what to do. I tried checking my passwords, but I still don't understand all the configuration for MySQL. I tried reconfiguring the myth packages, but couldn't get through the setup. It would just bounce me out after a few attempts because of incorrect password sets.

I finally figured out, from the logs, that MySQL hadn't logged anything since it's 'successful shutdown' after the updates. It hadn't even tried to come on. I started it manually and everything seems to be fine, but how do I get it to start at startup again?

View 3 Replies View Related

Software :: Cannot Get Php Script To UPDATE Mysql Database

Apr 11, 2011

I'm having problems with my coding. Here is the problem: I have a database with a list of products. I can list all the products OK At the side of each product I have an EDIT and DELETE button. The delete button works fine and deletes the item. The EDIT button displays a form with all the details from the database. I can then edit this form and click on UPDATE. This is the code that I have to update the database:

$group = $_REQUEST['group'];
$description = $_REQUEST['description'];
$quantity = $_REQUEST['quantity'];
$price = $_REQUEST['price'];
$type = $_REQUEST['type'];
$type2 = $_REQUEST['type2'];
$order = $_REQUEST['order'];
$status = $_REQUEST['status'];
[Code]....

I cannot see anything wrong with this code. But when I click on UPDATE (in the form), I get Error in executing UPDATE exhausts SET group = 'Alloy Silencers', description = 'RS 125 Aprilia', quantity = '1', price = '57.00', type = 'alloy', type2 = 'all', order = '', status = '1' WHERE id = '3' query

error:1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group = 'Alloy Silencers', description = 'RS 125 Aprilia', quantity = '1', price' at line 1I have used this code many time before in other projects without problems.

View 2 Replies View Related

CentOS 5 :: Yum Broke After Update And Installing MySQL TOP

Nov 28, 2009

After updating and installing Mysql's TOP, yum broke. When trying to clean, update, or install, the following error occurs:

dingle@its:/home/dingle# yum update
There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named cElementTree
Please install a package which provides this module, or verify that the module is installed correctly.
It's possible that the above module doesn't match the current version of Python, which is:
2.4.3 (#1, Sep 3 2009, 15:37:12)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
If you cannot solve this problem yourself, please go to the yum faq at: [URL]

I tried to resolve by reinstalling the dependency, didn't work either:
dingle@its:/home/dingle# rpm - [URL]
Retrieving [URL]
Preparing... ########################################### [100%]
package python-elementtree-1.2.6-7.el4.rf.i386 (which is newer than python-elementtree-1.2.6-5.i386) is already installed

How can I rebuild YUM appropriately so it will operate correctly?

View 1 Replies View Related

Ubuntu Servers :: Update Process (and I) Can't Stop Mysql?

Mar 10, 2010

I'm running an update, and get this:

Code:
The following packages will be upgraded:
apache2 apache2-doc apache2-mpm-prefork apache2-utils apache2.2-common libcupsys2 libmysqlclient15-dev linux-libc-dev mysql-server
mysql-server-5.0 php5-imap sudo
12 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.

[Code]...

View 1 Replies View Related

Ubuntu :: Mysql Stop Working After Today's Update

May 26, 2010

I'am using ubuntu lucid, after today's system updates, mysql stop working at all. Log file at /var/log/mysql/error.log does not say anything about today, and whe I try to start it the terminal hang also in verbose mode.

View 9 Replies View Related

Programming :: Using Perl To Update Mysql Table On Certain Event?

Feb 6, 2011

I'd like to use a perl script to update a fields in mysql database when pianobar (command line pandora radio player) starts a new song. Pianobar has the ability to run a script based on events, I'd like to take advantage of and use perl toparse the artist,song,album and update the corresponding fields. Then later retrieve them and display them with php/html. I am by no means proficient with perl. I started to use bash, but it looks like perl will be much more efficient and and less time consuming.

Code:
#! /usr/bin/perl -wT
use strict;

[code]...

View 2 Replies View Related

Programming :: Bash File Comparing - Report How Many Matching Words My Main File ?

Jun 9, 2009

I have been messing with diff and grep for 2 days now without result

I am trying to match a file consisting of words to many separate other wordfiles in a specific directory. one by one.

What i want the script to do is to report how many matching words my main file has with every file in the directory, each in turn

setup:

Each of em are plain text files with 1 word per line

Output should be something like:

SCRIPT REPORT:

View 8 Replies View Related

Ubuntu :: Help With Bin File - Error Message - Bash - /hldsupdatetool.bin - No Such File Or Directory

Jun 9, 2009

I am new to Linux and I wanted to setup a dedicated game server on my notebook.

I've installed Ubuntu 9.04. I than created a directory named /home/phlex/kfserver. I downloaded the application binary from Steam. I changed the file permission with chmod +x hldsupdatetool.bin and now the file attributes are -rwxr-xr-x.

The problem is when I try to run the binary file. If I type ./hldsupdatetool.bin I get an error message "-bash: ./hldsupdatetool.bin: No such file or directory. It seems the OS can't find the file. I've downloaded the file several times thinking it may have been corrupt but it's not. I can delete the file, I can rename it and so the file is there. Sometimes Linux can be aggravating to use.

View 7 Replies View Related

General :: Printing From Bash Shell / Concatenate Files Into One File With File Names Included?

May 11, 2011

I am supposed to take some small files, and print them to a specific printer, such that the small files are concatenated into one file. The file name has to be included in the file that gets printed.

Should I be looking to concatenate the files into one file with the file names included, and then print them?

something like: -printfunction -printername < file*

View 7 Replies View Related







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