-2

How do I change my root user to any other local user on mysql db?Since I have installed Ubuntu all the work is done by this superuser root now just don't want root to do all stuff of mysql...

4
  • Do you want to allow access on your mysql db to user from any remote system? May 18, 2016 at 6:02
  • Please tag mysql also. It is confusing otherwise.
    – ankit7540
    May 18, 2016 at 6:51
  • Is your issue solved ?
    – ankit7540
    May 26, 2016 at 9:36
  • You should make your question more clear and easier to understand, see as well how to ask a good question. Thank you.
    – Videonauth
    Jun 10, 2016 at 6:16

1 Answer 1

3

You do not need to change the root user.

For purpose of data operations we usually create a new mysql user and grant certain privileges to this user (generally limited to a database).

This can be done in following ways:

  1. From terminal

mysql -u root -p

and enter the root password. Then, in the terminal you will see as mysql> indicating you are logged in as root in mysql.

Now you can create/modify users. For creating users,

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

then you can grant some prvileges to this new user by,

GRANT ALL ON database_name.table_name TO 'username'@'localhost';

and you can check privileges by SHOW GRANTS FOR 'username'@'localhost';

This is a very general description and refer to the manual here for details. MySQL man page for creating/modifying user

  1. phpmyadmin

This is a browser based tool which allows for doing all the user-management and database management job in one place.

After installation and configuration of this tool, phpmyadmin can be accessed in the local computer as http://localhost/phpmyadmin . After login (as root or as a specific user), management operations can be performed.

Please refer to other links about installation and usage.

Official page phpMyAdmin

1
  • @Deepak - Accept the answer if problem solved. This also closes the question.
    – ankit7540
    May 19, 2016 at 10:31

Not the answer you're looking for? Browse other questions tagged .