Solved Set/Reset MySQL Password after the installation.

Zvoni

Member

Reaction score: 24
Messages: 67

i don't bother with that script.
What i do after a MySQL-Server-Install
1) check my.cnf, that it has everything neccessary (e.g. tablenames in lowercase, auth-plugin is "mysql_native_password" etc.) BEFORE starting the Server the first time!
2) sysrc mysql_args="--initialize-insecure --user=mysql"
Start the MySQL-Server. And wait for it to finish
3) sysrc mysql_args="--skip-grant-tables"
restart the MySQL-Server
4) mysql -uroot (Note: No "-p")
5) "Use mysql;" (Switch to system-DB)
6) "update user set authentication_string='' where user='root';" (Deleting whatever random password was generated)
7) quit
8) sysrc -x mysql_args
restart the MySQL-Server
9) mysql -uroot (again no "-p")
10) "alter user 'root'@'localhost' identified by 'mypassword';"
11) quit
restart MySQL-Server
 
Top