Announcement

Collapse
No announcement yet.

Grant root user as super user in MySQL

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Grant root user as super user in MySQL

    Hi Everyone,

    How to make "root" user to have access to all databases with full privillege ?

    Because at the moment i always grant everything by using root but when i tried to connect to mysql db instance from TOAD for MySQL i got Access denied for user 'root'@'mylaptop.domain.com' (using password: YES) ?

    more like:

    SA in SQL Server
    SYS in Oracle


    Code:
    [email protected]:/tmp$ mysql -u root -p
    
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 248
    Server version: 5.1.41-3ubuntu12.6 (Ubuntu)
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql> grant all on database.* to [email protected];                        
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database.* to [email protected]' at line 1
    
    mysql> grant all on database.* to [email protected] identified by 'root';
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database.* to [email protected] identified by 'root'' at line 1
    
    mysql> grant all on database.* to 'root' identified by 'root';
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database.* to 'root' identified by 'root'' at line 1
    
    mysql> grant all on database.* to '[email protected]' identified by 'root';
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database.* to '[email protected]' identified by 'root'' at line 1
    
    mysql>
    I tried to grant it but always failed.
    any kind of help would be greatly appreciated.

    Thanks.

  • #2
    Re: Grant root user as super user in MySQL

    Having never used MySQL i can only guess that this would be right

    http://www.devarticles.com/c/a/MySQL...ions-in-MySQL/

    If that deosn't work try

    http://www.google.com.au/search?q=my...ient=firefox-a

    Comment


    • #3
      Re: Grant root user as super user in MySQL

      think you need

      grant all on * to 'root'@'localhost' identified by 'password'
      flush privileges;

      try that

      (root already as privs by default)

      try 'root'@'%' (I think it is)

      http://dev.mysql.com/doc/refman/5.1/...ing-users.html

      mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
      mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
      -> WITH GRANT OPTION;
      mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
      mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' WITH GRANT OPTION;
      mysql> CREATE USER 'admin'@'localhost';
      mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
      mysql> CREATE USER 'dummy'@'localhost';
      (bolded by me)
      Please do show your appreciation to those who assist you by leaving Rep Point https://www.petri.com/forums/core/im.../icon_beer.gif

      Comment

      Working...
      X