You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// e.g. you delete all your Ghost instances from your droplet and start from scratch, the MySQL users would remain and the CLI has to generate a random user name to work
84
-
// e.g. if we would rely on the instance name, the instance naming only auto increments if there are existing instances
85
-
// the most important fact is, that if a MySQL user exists, we have no access to the password, which we need to autofill the Ghost config
86
-
// disadvantage: the CLI could potentially create lot's of MySQL users (but this should only happen if the user installs Ghost over and over again with root credentials)
returnthis._query(`SET PASSWORD FOR '${username}'@'${dbconfig.host}' = PASSWORD('${randomPassword}');`);
88
+
returnthis._query(`SELECT PASSWORD('${randomPassword}') AS password;`);
89
+
}).then((result)=>{
90
+
this.ui.logVerbose('MySQL: successfully created password hash.','green');
91
+
92
+
consttryCreateUser=()=>{
93
+
// IMPORTANT: we generate random MySQL usernames
94
+
// e.g. you delete all your Ghost instances from your droplet and start from scratch, the MySQL users would remain and the CLI has to generate a random user name to work
95
+
// e.g. if we would rely on the instance name, the instance naming only auto increments if there are existing instances
96
+
// the most important fact is, that if a MySQL user exists, we have no access to the password, which we need to autofill the Ghost config
97
+
// disadvantage: the CLI could potentially create lot's of MySQL users (but this should only happen if the user installs Ghost over and over again with root credentials)
0 commit comments