Tuesday, August 4, 2020

[google-cloud-sql-discuss] Re: Access denied for user 'root'@'%' (using password: YES) with mysql hosted in GCP

Hello Vinod, 

In such cases, you are not supposed to use a system user (such as root@localhost) as the DEFINER for triggers, view, or stored procedures. Cloud SQL is a managed environment, and the root user has all privileges except SUPER and FILE. You should formulate your queries accordingly. 

The actual procedure to import data into a Cloud SQL instance is detailed on the "Importing data into Cloud SQL" documentation page, consisting in: 

1. Go to the Cloud SQL Instances page in the Google Cloud Console.
2. Select the instance to open its Overview page.
3. Click Import in the button bar.
4. Under Choose the file you'd like to import data from, enter the path to the bucket and SQL dump file to use for the import. Or to browse to the file:
   a. Click Browse.
   b. Under Location, double-click the name of the bucket in the list.
   c. Select the file in the list.
   d. Click Select.
You can import a compressed (.gz) or an uncompressed (.sql) file.

5. For Format, select SQL.
6. Select the database you want the data to be imported into.
    This causes Cloud SQL to run the USE DATABASE statement before the import.

    * If your SQL dump file includes a USE DATABASE statement, it overrides the database you set in the console.
7. Click Import to start the import.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/be24b3bb-7a99-42ac-ab8b-66b6c0145787o%40googlegroups.com.

No comments:

Post a Comment