Create a new MySQL user in XAMPP

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


It's too late but I'm sure my answer will help the community.

  1. To create a new mysql user in XAMPP you need to type the following commands:
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.

  1. To delete MySql user definitively you should run this command
DELETE FROM mysql.user 
WHERE  user = 'root' 
     AND host = 'localhost';

Hope that it's helpful.

Tags:

Mysql

Xampp