Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

command not working

Posted on 2009-05-08
2
Medium Priority
?
170 Views
Last Modified: 2012-05-06
I have a client that has 2 cpanel servers with me running joomla installations.  He needs to execute this command within joomla I believe.  One of the servers the command works just fine, the other though, it doesn't even though they're very similar builds.

$command="nohup mysql -u ".$user." -p".$password." ".$dbname." < ".$sqlfile;
passthru($command);

It's not seeming to work and he did get it sort of work, but he's sitll saying there are problems.  He used this command to get past it:

$command="/usr/bin/mysql -u ".$user." -p".$password." ".$dbname." < ".$sqlfile;
$sqlit=passthru($command);

What Changed was:"nohup mysql -u " to  "/usr/bin/mysql -u "

Does anyone know what's going on and why nohup would work on the one server and not on the other.
0
Comment
Question by:allwebnow
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 1200 total points
ID: 24339183
Do not use -p for the password as this prompts an interactive input. Use --password instead like so

$command="/usr/bin/mysql -u ".$user." --password=".$password." ".$dbname." < ".$sqlfile;
$sqlit=passthru($command);
0
 
LVL 2

Assisted Solution

by:lavinpj1
lavinpj1 earned 800 total points
ID: 24339210
-p prompts for a password, -pPasswordhere doesn't.

Phil
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
In this article, we’ll look at how to deploy ProxySQL.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question