To create a MySQL admin user (also known as a superuser) account, you can follow these steps:
mysql
command-line client. You will need to use a user account with administrative privileges to do this:mysql -u root -p
CREATE USER
statement. Replace username
with the desired username and password
with the desired password:CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
GRANT
statement. For example:GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost';
This will grant the new user all privileges on all databases and tables.
FLUSH PRIVILEGES;
exit
You can now use the new user account to connect to the MySQL server with administrative privileges.