This one liner will find ALL WordPress installs and create the database, assign the user / password to that database automatically.

Written by Justin Catello Updated over a week ago

A lot of times when we migrate a user from a cPanel based server over to a LEMP stack, it can be very time consuming to create all new databases along with assigning a database user / password to access that database. This one liner will do all the work for you.

Simply run this in the parent directory of the WordPress installs, it will search for all wp-config.php scripts, pull the database, user and password, create the database, and lastly assign the user / password to the database.

*It does require mysqladmin which most will have available by default.