How to create a new WordPress admin user via MySQL

This is the most redundant post on the internet and the only reason I am adding this here is for my own reference to come copy and paste (whenever the need comes up).

Simply copy and paste the snippet below in your MySQL database (can be done in any tool connected to the database, e.g. PhpMyAdmin, Sequel Pro or MySQL Workbench)

REMEMBER: to update your database table prefixes if they have changed, e.g: rename the ‘wp_’ to the new prefix ‘wpxsdas21_’ — if ‘wpxsdas21_’ is really your new table prefix.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store