dimanche 1 février 2015

MYSQL : unable to add privileges to newly created user


I am just trying out Google Cloud SQL. Created a SQL server and white-listed one of my IPs to connect to it.


I am able to connect as root@'%' there and do everything I wish, other than granting privileges to users.


I created a user using the following command :



CREATE USER 'something'@'Fixed_IP' identified by 'some_pass';
SUCCESS

GRANT ALL PRIVILEGES ON *.* TO 'something'@'Fixed_IP' ;
ERROR 1045 (28000): Access denied for user 'root'@'%' (using password: YES)


Why I am facing this when I am logged in as 'root'@'%' ?


Some more details about my mysql user_base as of now :-



mysql> select user, host from mysql.user;
+---------+-----------------+
| user | host |
+---------+-----------------+
| root | % |
| new_db | Fixed_IP |
| new_sv1 | Fixed_IP |
| test | Fixed_IP |
| root | 127.0.0.1 |
| root | ::1 |
| | localhost |
| root | localhost |
+---------+-----------------+
8 rows in set (0.06 sec)

mysql> show GRANTS for 'root'@'%';
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@% |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'root'@'%' IDENTIFIED BY PASSWORD '*3481764187236481732qhuwieduqwedqwe789732' WITH GRANT OPTION |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.06 sec)




Aucun commentaire:

Enregistrer un commentaire