Functions
WebDev/*nix assorted functions & hacks
Search
find all
Array
-
Bash
-
Classes
-
Config
-
DateTime
-
Debug
-
dotjs
-
File
-
foooo
-
Git
-
HTML
-
Images
-
Javascript
-
Linux
-
Math
-
Misc
-
MySQL
-
OS X
-
Reading
-
Redis
-
Shell scripts
-
snippets
-
SQL
-
Strings
-
TextMate
-
Web
-
\(^o^)/ Fun!
-
_Misc hacks
-
_Pages
MySQL
fetch_field(), fetch_row(), fetch_rows(), mres()
query($sql)
Unicode
Unicode configuration
You forgot your MySQL root password AGAIN
5
found
auth
Name:
Category: MySQL
Body:
### I forgot my root password AGAIN How to reset mysql root password: As per http://ubuntu.flowconsult.at/en/mysql-set-change-reset-root-password/ Stop the MySQL Server. $ sudo /etc/init.d/mysql stop (That line complains about something or other being outdated, make a note of that next time and update this. This was nr 1 in Google results and it worked, hmkay?) Start the mysqld configuration. $ sudo mysqld --skip-grant-tables & If that refuses to stay up for longer than a couple seconds (or at all), make sure the pid file is deleted as well. Killing the MySQL process in various ways won't remove that file. It can be located in the data folder. Login to MySQL as root. $ mysql -u root mysql Replace YOURNEWPASSWORD with your new password! $ UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit; Then presumably stop and start your server again. Final step: STOP FORGETTING THAT PASSWORD!! (write it down or something, or store it in ..ehr, a different database. or the keychain. or the browser, or 1password.) ### Yes but I also nuked all the databases, including the ones that MySQL needs to even start $ mysqld --initialize or maaaybe (older versions?) $ mysql_install_db as per https://stackoverflow.com/a/8911226/126584 ### And for good measure I nuked the user that I was using along with say, the users table To insert a new user with privs & pass, something like GRANT ALL PRIVILEGES ON *.* TO 'database_user'@'localhost' IDENTIFIED BY 'sekrit';
Footer