title: MySQL 5.7 how to choose root password after mysqld --initialize
body: <p>If I do "mysqld --initialize-insecure", it will be fine with login after initialization, but if I omit "insecure", that will be secure initialization, after which I need a password to login, but I haven't set any password yet.</p>
  
  <p>The menu <a href="https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html" rel="noreferrer">data-directory-initialization-mysqld</a> indicates that "Regardless of platform, use --initialize for “secure by default” installation (that is, including generation of a random initial root password). In this case, the password is marked as expired and you will need to choose a new one."</p>
  
  <p>I thought that would be the problem, that mysql initializes the super administrative account "root" with a "random password" and "marked as expired", I need to "choose a new one", but how?</p>
  
  <p>Should I try <code>mysqld --initialize -p 'mypassword'</code> or should I type some other prompt clause after initialization?</p>
  
  <p>This problem really bothers me(for twice, I gave up last time after a long time  solution searching), indeed I do not need a secure mode to serve data just for testing my app locally, but I'd like to know how to initialize a secure root account for further usages.</p>
  
  <p>I am not sure what I am missing after reading the manu and google it for 4 hours , again.</p>
  
  <p>Thank you.</p>