How to allow the user "sonia" to connect to the server from localhost using the password "passwd". Login as root. Switch to the mysql db. Give privs. Update privs.



How to allow the user "sonia" to connect to the server from localhost using the password &..

Answer / Sanjay Kumar Jain

To allow the user 'sonia' to connect to the server from localhost using the password 'passwd' in MySQL, you need to login as root, switch to the mysql database, grant privileges using GRANT command, and update privileges using FLUSH PRIVILEGES command. Here's an example: `mysql -u root; CREATE USER 'sonia'@'localhost' IDENTIFIED BY 'passwd'; GRANT ALL PRIVILEGES ON your_database_name.* TO 'sonia'@'localhost'; FLUSH PRIVILEGES;`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More MySQL Interview Questions

Explain the architecture models of SQL Server?

1 Answers  


What is mysqli_result?

1 Answers  


How we can get the current date in mysql?

1 Answers  


List some comparisons operators used in mysql?

1 Answers  


Is null in mysql?

1 Answers  


How do I find mysql database?

1 Answers  


How MySQL Optimizes DISTINCT?

1 Answers  


How many columns can a mysql table have?

1 Answers  


How do I create a mysql username and password?

1 Answers  


How do you kill a long running query in mysql?

1 Answers  


How do I grant privileges to a user in mysql phpmyadmin?

1 Answers  


How is myisam table stored?

1 Answers  


Categories