tags:

views:

41

answers:

2

In linux I can use ! to start a shell command:

mysql >\! ping localhost

Is there a way to get the output of shell in MySQL?

A: 

Not really. But take a look at this or this

ghostdog74
In fact I want to execute PHP inside MySQL..
A: 

While in the mysql prompt, no. You can however pipe the results of a command into mysql with something similar to:

mysql -u user -ppassword < `ping localhost`

The only issue with this is that whatever your shell command returns needs to be the sum of the commands/data you want to issue to mysql. This is most commonly used to execute a script or something similar.

Chris S
No,this is not run in MySQL environment.