google cloud sql -- mysql import issue - mysql

I am trying to import a table in a newly created instance in google MySQL cloud but I get the following error message:
Error 1142: INSERT command denied to user 'cloudsqlimport'#'127.0.0.1' for table
When I try to grant the privileges to cloudsqlimport from cloud sql console:
mysql> UPDATE `mysql`.`user` SET `insert_priv` = 'Y' WHERE `User` = 'cloudsqlimport';
ERROR 1142 (42000): UPDATE command denied to user 'root'#'104.xxx.xx.xx' for table 'user'
mysql> UPDATE `mysql`.`user` SET `Grant_priv` = 'Y' WHERE `User` = 'root';
ERROR 1142 (42000): UPDATE command denied to user 'root'#'104.xxx.xx.xx' for table 'user'
Same issue when I try to grant the 'insert_priv' through MySQL workbench
How can I resolve this issue?

This error might be due to one of the following causes:
1- Lack of permissions
2- Database or Table spelled wrongly.
3- User correctly spelled but the IP is not correct.
To see the permissions your user has, Please log into MySQL prompt with your user, and run the following command:
SHOW GRANTS;
This will show you the privileges (grants in MySQL) that the current user has. Please check if you have INSERT privileges for the given table.

Related

Granting privileges for Importing data to AWS Lightsail MySQL

I have a MySQL database running on AWS Lightsail. I'm trying to import data into MySQL using MySQL Workbench, but see following error:
ERROR 1227 (42000) at line 20: Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation
Upon trying to grant access to dbmasteruser using following command:
UPDATE mysql.user SET Super_Priv='Y' WHERE user='dbmasteruser' AND host='%';
I see following error:
ERROR 1054 (42S22): Unknown column 'ERROR (RDS): SUPER PRIVILEGE CANNOT BE GRANTED OR MAINTAINED' in 'field list'
Using following command:
mysql> GRANT SUPER ON *.* TO dbmasteruser#'%';
I see following error:
ERROR 1045 (28000): Access denied for user 'dbmasteruser'#'%' (using password: YES)
I seems I stuck in a loop: I cannot import data and dbmasteruser doesn't have privileges neither to import nor to grant certain privileges to import.
I also see rdsadmin user with DBA privileges, but no idea where to get password in Lightsail for this user.
I had the same issue: I exported an existing database with MySql Workbench (this was an older MySQL version) and tried to import it into my AWS Lightsail Database - wich didn't work.
The reason were some operations in the mysql dump, which are not allowed for the Lightsail user. I just commented out the mentioned lines and the import worked as expected (in your case it's line 20).
For me I needed to comment out the following statements:
-- All lines that begin with
SET ##SESSION.SQL_LOG_BIN...
SET ##GLOBAL.GTID_PURGED...

why the following errors occurs in creation of databases?

I tried to create databases but the following error occurs?
mysql> create database sample;
ERROR 1044 (42000): Access denied for user 'db_cad'#'%' to database 'sample'
your user "db_cad" don't have rights to create table after connecting to from another machine on sample database.
using following commands you can check your rights.
show grants;

How to set SUPER privilege for a database

When I import data and got below problem(error-1) When I try to google it and from the link http://dev.mysql.com/doc/refman/5.6/en/grant.html#grant-privileges I check out Global Privileges and use this id dql editor - GRANT ALL ON . TO 'dev-1'#'localhost'; Which give me error -2
error-1
SQL query:
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`ars_user465`#`%` SQL SECURITY DEFINER */
/*!50001 VIEW `constantcontact_customers_agents` AS select `customers`.`CustomerID` AS `CustomerID`,`customers`.`AgentID` AS `AgentID`,`customers`.`AccountType` AS `CustomerAccountType`,`customers`.`FirstName` AS `CustomerFirstName`,`customers`.`LastName` AS `CustomerLastName`,`customers`.`Address` AS `CustomerAddress`,`customers`.`City` AS `CustomerCity`,`customers`.`State` AS `CustomerState`,`customers`.`Zip` AS `CustomerZip`,`customers`.`Phone` AS `CustomerPhone`,`customers`.`Cell` AS `CustomerCell`,`customers`.`Fax` AS `CustomerFax`,`customers`.`Email` AS `CustomerEmail`,`customers`.`Dob` AS `CustomerDob`,`agents`.`FirstName` AS `AgentFirstName`,`agents`.`LastName` AS `AgentLastName`,`agents`.`CompanyName` AS `AgentCompanyName`,`agents`.`ApiUsername` AS `ApiUsername`,`agents`.`ApiPassword` AS `ApiPassword` from (`customers` join `agents` on((`customers`.`AgentID` = `agents`.`AgentID`)[...]
MySQL said:
#1227 - Access denied; you need the SUPER privilege for this operation
error -2 :
#1045 - Access denied for user 'dev-1'#'%' (using password: YES)
error1: The user you are logged in with needs the super privilege.
Error: 1227 SQLSTATE: 42000 (ER_SPECIFIC_ACCESS_DENIED_ERROR) Message:
Access denied; you need the %s privilege for this operation
error2: Most likely, the user you are logged in with (dev-1#%) doesn't have the Grant privilege.
Run SELECT USER(), CURRENT_USER(); to confirm you are logged in as the user you think you are.
Then run SELECT user,host,grant_priv from mysql.user where grant_priv = 'Y'; To confirm if that user has the GRANT privilege. If not you will need to log as a user with the GRANT privilege to assign the super privilege. (quite often these users are localhost only be default).

Mysql error message:"#1044 - Access denied for user 'root'#'localhost' to database 'information_schema' " when trying to delete a table view

I would like to know how to handle this error error "#1044 - Access denied for user 'root'#'localhost' to database 'information_schema' " in order to delete a table view in a Mysql database. The explanation is as below:
I have a database called "wkayetdb" which contains a table view called "v_eventgroup". In order to delete that table view, I executed this SQL request:
SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_SCHEMA = 'wkayetdb' AND TABLE_NAME = 'v_eventgroup';
Then, after obtaining the result of the SQL request above and after clicking on the delete button to delete the view, I got this error message: #1044 - Access denied for user 'root'#'localhost' to database 'information_schema'.
So, how can I handle this error?
You need to either retrieve or reset the MYSQL password.
http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

Privileges issue

I have a mysql database (version 5.5), and I am trying to add a new user.
But I don't have the privileges to create it.If I try to show the list of all users:
select * from mysql.user;
It gives this error:
ERROR 1142 (42000): SELECT command denied to user ''#'localhost' for table 'user
It seems like I am not able to do anything.How to grant the privileges for a user without using the grant command?
There's a way? I also tried this:
CREATE USER 'ramy'#'localhost' IDENTIFIED BY 'pass';
It says:
ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
I don't see any way to handle privileges, mysql show have a method to handle privileges for who have newly created a database.That's a vicious circle.
You need to login as the 'root' account
See this if you don't know the root password
http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html