CREATE USER IF NOT EXISTS 'root'@'%' IDENTIFIED BY '<%= p('cf_mysql.mysql.admin_password') %>';
GRANT ALL PRIVILEGES ON *.* TO '<%= p('cf_mysql.mysql.admin_username') %>'@'%' WITH GRANT OPTION;
UPDATE mysql.user SET Password=PASSWORD('<%= p('cf_mysql.mysql.admin_password') %>') WHERE User='<%= p('cf_mysql.mysql.admin_username') %>';
DELETE FROM mysql.user WHERE User='';
FLUSH PRIVILEGES;

CREATE USER IF NOT EXISTS '<%= p('cf_mysql.mysql.admin_username') %>'@'%' IDENTIFIED BY '<%= p('cf_mysql.mysql.admin_password') %>';
GRANT ALL PRIVILEGES ON *.* TO '<%= p('cf_mysql.mysql.admin_username') %>'@'%' WITH GRANT OPTION;
UPDATE mysql.user SET Password=PASSWORD('<%= p('cf_mysql.mysql.admin_password') %>') WHERE User='<%= p('cf_mysql.mysql.admin_username') %>';
DELETE FROM mysql.user WHERE User='';
FLUSH PRIVILEGES;

Use admin_username when creating the user
Use admin_username when creating the user

[#130544249]

Signed-off-by: Andrew Crump <bad96bc28586e95c5d7da81c13d926ea5028b22f@pivotal.io>
