pureless Posted January 1, 2014 Share Posted January 1, 2014 (edited) I will pretense this with: I have not lost my password. However, using 4.1+ requires the use of a hashed password. My question, is if i should misplace this long string of random letters and numbers, how would i go about recovering it? It seems a bit inconvenient to require a 10+ character string of random letters to log in. I just wanted to get my answer before the event occurs (which it likely will at some point, with one of my databases). Any advice or pointers on what im missing would be great Edited January 1, 2014 by pureless Quote Link to comment https://forums.phpfreaks.com/topic/285017-mysql-41-hashed-password-recovery/ Share on other sites More sharing options...
kicken Posted January 1, 2014 Share Posted January 1, 2014 Are you talking about the password used to access a mysql database? There is no rule regarding how long or complex the password needs to be. Most of my passwords for my development stuff are short and simple. As for recovering a password however, you don't recover it. You just change it by starting the mysqld service with grant tables disabled (ie, authentication disabled) then you update the users table with a new password. Once done restart mysqld as normal and login with the new password. The process is documented in the manual: C.5.4.1. How to Reset the Root Password Quote Link to comment https://forums.phpfreaks.com/topic/285017-mysql-41-hashed-password-recovery/#findComment-1463508 Share on other sites More sharing options...
pureless Posted January 1, 2014 Author Share Posted January 1, 2014 Yes the password to access the database. However you don't get to choose how long or what it is in 4.1+ compatability. You type in your password then hit "generate" which gives you a string of random letters, which is now your database password. Before doing this (when using my standard chosen password), PHP refused to connect with it until the password was updated to the new method. I'm just not fully convinced that i need to have that string of randomness saved in a file with hopes i never lose it... Quote Link to comment https://forums.phpfreaks.com/topic/285017-mysql-41-hashed-password-recovery/#findComment-1463512 Share on other sites More sharing options...
pureless Posted January 1, 2014 Author Share Posted January 1, 2014 I retract my question. Apparently hashing the password is an option and not necessarily required as i thought it was. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/285017-mysql-41-hashed-password-recovery/#findComment-1463513 Share on other sites More sharing options...
kicken Posted January 1, 2014 Share Posted January 1, 2014 You must be using some third-party administration tool which is providing this hashing option, as there is no such thing in the standard mysql stuff. To create a user and give them access to a DB in mysql you just issue a GRANT statement, eg: grant all on dbname.* to username@hostname identified by 'theirPassword'; You can type whatever value you want in for theirPassword (or leave it out entirely for no password). Quote Link to comment https://forums.phpfreaks.com/topic/285017-mysql-41-hashed-password-recovery/#findComment-1463542 Share on other sites More sharing options...
pureless Posted January 1, 2014 Author Share Posted January 1, 2014 Ya, i connect via phpMyAdmin. When you change a password it has an option to use 4.1+ password hashing which is a larger hash than previous versions used. And below entering your password you hit generate to generate a random string. I was under the impression that was a necessary step and was generated in correspondence to the password you entered. When i tried again without generating this string, i was able to connect with my standard password. Was a simple user error on an assumption i made. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/285017-mysql-41-hashed-password-recovery/#findComment-1463557 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.