Bug #36730 Bug in 'B.1.4.1.2. Resetting the Root Password': --init-file needs absolute path
Submitted: 15 May 2008 3:58 Modified: 20 May 2008 15:16
Reporter: web chick Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:3.2/4.0/4.1, 5.0, 5.1, 6.0 OS:Linux (Ubuntu )
Assigned to: Paul DuBois CPU Architecture:Any

[15 May 2008 3:58] web chick
Description:
Step 4 at http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-un... reads:

---
4. Restart the MySQL server with the special --init-file=~/mysql-init option:

shell> mysqld_safe --init-file=~/mysql-init &

---

But this doesn't actually work; you need to specify the full path to the mysql-init file. 

How to repeat:
Attempt to paste in the command above. mysqld_safe will refuse to start:

---
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[369]: started
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[384]: ended
---

I don't believe this is specific to my system; On the referenced page there are several reports of the relative path issue dating back from October 25 2005.

Suggested fix:
The text needs to reflect the full system path, rather than the relative path. I'd also recommend making the "delete the ~/mysql-init file" a separate step, as it's easy to miss.

So if it were me, I'd change the rest of the text in this section to:

---

4. Restart the MySQL server with the special --init-file=/home/username/mysql-init option:

shell> mysqld_safe --init-file=/home/username/mysql-init &

The contents of the init-file are executed at server startup, changing the root password.

5. After the server has started successfully you should delete ~/mysql-init.

shell> rm /home/username/mysql-init

6. You should be able to connect using the new password. 
---

Hope that helps!
[15 May 2008 4:15] Paul DuBois
Will fix this by updating the instructions, and deal with Bug#36476 at the same time.
[20 May 2008 15:16] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.