I’m working on a bash script and need a bit of help, this is what I currently have.
mysql -e "create database if not exists ${UN}_${SQLBASE}"
mysql -Be "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, CREATE ROUTINE ON \`"$UN"\\_"$SQLBASE"\`.* TO '"$UN"_"$SQLUSER"'@'localhost' IDENTIFIED BY '$SQLPASS';FLUSH PRIVILEGES"
Pretty much, I need to know how I can create a database with the name cpanel_db1, if that exists then automatically move up to the number up. ex cpanel_db2.
could be done something like this:
~
~