Share
How can I create an admin account in a MySQL database with MD5 encryption after accidentally deleting the admin record from the database?
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Answer ( 1 )
Here is the video demo for your question:
To create an admin account in MySQL database with MD5 encryption, you can follow these steps:
user
table, ensuring to replace the placeholder values with the appropriate information:INSERT INTO user (user_type, name, login_id, password, status)
VALUES ('admin', 'Admin Name', 'admin_login', MD5('admin_password'), 'active');
In the above query,
'admin'
represents the user type for the admin account,'Admin Name'
is the name of the admin user,'admin_login'
is the desired login ID for the admin account,'admin_password'
is the password you want to set for the admin account, and'active'
represents the status of the account. Adjust these values as per your requirements.After executing the query, the admin account should be created in the
user
table with the specified login ID, password encrypted using MD5, and other details.