How do I create a new MySQL user in XAMPP? Also, can I delete the existing “root” user?
MySQL CREATE USER ExampleStep 1: Open the MySQL server by using the mysql client tool. Step 2: Enter the password for the account and press Enter. Step 3: Execute the following command to show all users in the current MySQL server. Step 4: Create a new user with the following command.
Open phpMyAdmin in XAMPP. The phpMyAdmin interface. If you're asked to log in, use the username “root” and enter your root password. If you haven't set one yet, you can leave it blank.
It's too late but I'm sure my answer will help the community.
mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
\q
This command grants the user all permissions.For more information about setting MySQL database permissions, please visit https://dev.mysql.com/doc/refman/5.5/en/grant.html.
DELETE FROM mysql.user
WHERE user = 'root'
AND host = 'localhost';
Hope that it's helpful.
The MySQL documentation is very good: http://dev.mysql.com/doc/refman/5.1/en/create-user.html
Securing your new installation: http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With