how to add 'user' in mysql . and why 'root' is default?
To add a new user in MySQL, you can use the CREATE USER statement followed by the GRANT statement.
Here's an example of how to create a new user named "newuser" with the password "newpassword":
Once the user is created, you can grant them privileges using the GRANT statement. For example, to grant the SELECT, INSERT, and UPDATE privileges on a database named "testdb" to the new user, you can use the following command:
Regarding the "root" user, it is the default administrative user in MySQL. The root user is created during the installation of MySQL and has the highest level of privileges, allowing it to perform any operation on the MySQL server, including creating and modifying users, granting and revoking privileges, and managing databases. The root user is usually created with a password, and you can log in to the MySQL server as the root user by specifying the username and password in the mysql client.