mysqlimport command not found in script

803 views
Skip to first unread message

chrisale

unread,
Feb 16, 2016, 10:28:58 AM2/16/16
to wview
Apologies, my previous email seems to have got stuck into the ubuntu thread. So I will try again.

Hi all,

It appears something is going on perhaps with the PATH on my MacOS X 10.11 box but it doesn’t seem consistent. When I run the normal sudo /opt/local/bin/wview-mysql-export script I get a
warning:
"/opt/local/bin/wview-mysql-export: line 208: mysqlimport: command not found”

for each of the csv files.

Yet if I run the normal command simply from the command line:
mysqlimport --local --compress --replace --fields-terminated-by=',' --host=www.alberniweather.ca —user=me —password=password medb /opt/local/etc/wview/export/archive.csv

It runs fine.

Ideas?

Chris


Chris Alemany
3854 6th Avenue
Port Alberni, BC
V9Y4M2
h:250-723-0889
m: 250-731-7930

Graham Eddy

unread,
Feb 16, 2016, 10:31:47 AM2/16/16
to wview Google Group

Check PATH under sudo mode e.g. echo it
_____________
Graham Eddy
from phone: forgive brevity

--
You received this message because you are subscribed to the Google Groups "wview" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wview+un...@googlegroups.com.
To post to this group, send email to wv...@googlegroups.com.
Visit this group at https://groups.google.com/group/wview.
For more options, visit https://groups.google.com/d/optout.

Sir Geek

unread,
Feb 16, 2016, 10:50:32 AM2/16/16
to wv...@googlegroups.com
If your MySQL install isn't in the "normal" path (/usr/, /bin, etc.) and it is somewhere like /usr/local/local, you will need to insure that you add that to the path (either in the cron file) or in the script you call the full path to it.


--
Matt Soffen

Chris Alemany

unread,
Feb 16, 2016, 12:33:54 PM2/16/16
to wv...@googlegroups.com
mysqlimport is in /opt/local/bin 
and $PATH reports /opt/local/bin while logged in with su, called with sudo or in the main admin account.

Chris

Chris Alemany

unread,
Feb 16, 2016, 12:35:34 PM2/16/16
to wv...@googlegroups.com
I’d definitely prefer a solution where we need not modify the wview-mysql-export file.

Sir Geek

unread,
Feb 16, 2016, 1:05:25 PM2/16/16
to wv...@googlegroups.com
Can you add a line to the crontab then ?

Something like this as one of the 1st lines in the crontab ?

PATH=/opt/local/bin:$PATH

If that doesn't work, Can you do a softlink from /opt/local/bin/mysql-import to /usr/bin/mysql-import ?

Chris Alemany

unread,
Feb 16, 2016, 5:36:24 PM2/16/16
to wv...@googlegroups.com
Adding it in the crontab didn’t seem to work in the ways I tried it but adding it to the export file did work so I’ll go with that for a while.

Considering the wviewconfig system adds WVIEW_CONF_DIR and WVIEW_DATA_DIR to the wview-mysql-export file perhaps we could also have the system create a MYSQL_PATH_DIR variable or some such to be able to add whatever PATHs you may need to the mysql settings in the system.  Then the text file would need not be modified manually.

Chris

Cheers,
Chris

Sir Geek

unread,
Feb 17, 2016, 9:13:39 AM2/17/16
to wv...@googlegroups.com
I think the issue is that Linux systems install MySQL into the /usr folder (so it is by default part of the normal path).
Reply all
Reply to author
Forward
0 new messages