Autonomía digital y tecnológica

Código e ideas para una internet distribuida

Linkoteca. MySQL


To reset the password for MySQL you first must create a new file with the following contents:

ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘PASSWORD’;

Where PASSWORD is the new password to be used. Save that file as ~/mysql-pwd.

Next, stop the MySQL daemon with the command:

sudo systemctl stop mysql

With the daemon stopped, issue the command:

sudo mysqld -init-file=~/mysql-pwd

Once your command prompt is returned, restart the MySQL daemon with the command:

sudo systemctl start mysql

You should now be able to log into the MySQL command prompt with the new admin password like so:

mysql -u root -p

When prompted, type the admin password and you’re good to go.

WP Migrate DB exports your database as a MySQL data dump (much like phpMyAdmin), does a find and replace on URLs and file paths, handles serialized data, then allows you to save it to your computer as an SQL file.