Jump to content

Create mysql database from script action


Recommended Posts

I'm trying to create a new mysql database as part of a workflow in a Script action, but nothing seems to be happening. I've tried:

mysql -uroot -pMYPASS -e 'create database {query}' > /dev/null 2>&1

and

usr/local/bin/mysql -uroot -pMYPASS -e "create database {query}" > /dev/null 2>&1

but I'm not getting anything created in MySQL. I have the > /dev/null 2>&1 in there so it doesn't throw exceptions that prevents {query} from getting passed to an Output Script.

 

Any ideas on how to get the db created?

 

Link to comment

I'm setting up a workflow for creating a new local WordPress site (will be adapting it for a few other systems once I have this one running). Since I can't trigger one action from another, I'm running a bash script to pull the latest WordPress, extract and do all of those tasks, then using a few output scripts to finish the process. I ended up using PHP to in an Output Script to create the database since whatever I tried, running a Script in Alfred wouldn't talk to the mysql command. I know multiple Actions are in the works, which would be perfect for this, but the concurrent output scripts works ok for now.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...