Dump of SQL database of instance via Cloud SQL Admin API v1beta4 - mysql

I've created Cloud Function written in node.js to make dump of database in SQL instance and I'm wondering, is there any recommendation about stopping all instance before making dump? I stopped instance, but after that i couldn't make "dump".
There is a documentation: https://cloud.google.com/sql/docs/mysql/admin-api/rest/v1beta4/instances/export

Related

How to connect Azure Database for MySQL flexible server in Azure SQL Server Database

I am trying to set up a connection between Azure MySQL flexible server and Azure SQL database mainly to read data from MySQL and store it in the SQL Server periodically (multiple times a day).
I was thinking of creating a stored procedure inside my SQL Server database; however, I cannot seem to get a connection from the SQL Server into the MySQL database.
I know with ODBC you can connect MySQL to on-prem SQL Server, but unfortunately, there is nothing I have found for the same functionality for Azure SQL Server.
Has anyone done this? Is this possible?
I have tried to set up an ODBC connection, but it did not work as the SQL Server is on Azure.
I tried setting up a linked server inside SQL Server straight to MySQL, but it doesn't seem possible as the SQL Server is not on-prem.
I tried creating external database objects based on the following link.
With all these approaches, my expectation was to surface the MySQL tables from Azure SQL Server/SSMS.
Thank you for your help in advance!
MySql Workbench is the perfect option for connecting the azure database for mysql.
for that we need to create flexible server in azure portal. I created flexible server in azure portal.
Image for reference:
I created database in flexible server by clicking add in in database option. it crated successfully.
Image for refence:
I installed MySQL Workbench in my local system.
you can get your required fields to connect the server in connect tab.
Image for reference:
I connected to the server by filling required fields.
Image for reference:
Click on ok. It connected successfully.
Image for reference:
AFAIK Export the data from Azure mysql flexible server in the form of sql script through MySQL work bench and import that file in Azure sql database through SSMS. IN this we can write data into Azure Sql database.
I have had to create an Azure Function App that contains a Timer function that reads the data from the MySQL data and pushes it to SQL Server every 15 minutes (as were the requirements).
Thank you for everyone for commenting.
It seems you can use Data-in replication.

Connect with existing MySQL database (OVH) from Cloud Functions

I have an existing database hosted by OVH and managed by PhpMyAdmin.
On the other side, I also have a Firebase project where I use several Cloud Functions.
I would like write, in my existing OVH database, datas from my Firestore collections (thanks to Cloud Functions).
Is there a way to connect my Cloud Functions to an existing database ?
I did read than is possible to connect Cloud Functions to MySQL database with Cloud SQL but it seems only for new database created from Cloud Platform, which is not my usecase as my database is already created and hosted by OVH.
Thank you for your help!
Depending on the programming language you are using on Cloud Functions, PHP for example:
1. <?php
2. $myPDO = new PDO('pgsql:host=host;port=port;dbname=dbname', 'username', 'password');
3. ?>
From what I can tell on the documents, you have to make sure your database is public, not private. Here is the official documentation.
If you have any issues, try reaching out to OVH support.

MySQL workbench database import from Azure SQL

I am currently trying to use the MySQL Workbench migration wizard to import a database located on an Azure SQL Managed instance to an on-premise MySQL server, but i have an issue with the wizard: it fails to retrieve the database schema with the following error:
'WARNING: The following catalogs were not found: database_name'
Note: The user i currently use to perform the migration is actually granted on VIEW DEFINITION at the database level but not at the server level (VIEW ANY DEFINITION) , since it is not supported in Azure SQL. Any idea about how to make this wizard work is welcomed.
Like #JeffRamos said before you using MySQL Workbench migration, please check if the user can connect to the Azure SQL Managed instance with SSMS and has the permission to access the Azure MI database. Just from the error message, it's not the firewall issue.
As I know about Azure Managed instance, if we want migrate the database, the user muse be db_owner or admin account.
HTH.

Restoring SQL backup on Amazon RDS database

How is it so difficult to find out how to do this? All I need is to run some simple SQL to restore our existing database on a new RDS database.
Tried connecting with SQL Server Management Studio, it won't connect.
Tried using the Database Migration Tool, it doesn't make any sense.
All the documentation for this seems to assume I'm trying to move some monumental database with zero downtime. Literally all I need to do is run an SQL file on a RDS database. Does anybody on earth understand how this works??
You can use Native backup and Restore. Amazon RDS supports native backup and restore for Microsoft SQL Server databases using full backup files.
Though it wouldn't work on db.t1.micro DB instance class.
You can add Native Backup and restore option by doing following according to the AWS docs.
Create a new option group, or copy or modify an existing option group.
Add the option to the option group.
Associate the option group with the DB instance.
After you add the Native Backup and Restore option, you don't need to restart your DB instance. As soon as the option group is active, you can begin backing up and restoring immediately.
If you cannot connect to the you need to check your RDS security group. Make sure port 3389 is open to your IP,
There is good documentation for connecting to RDS from the Management Studio here:
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToMicrosoftSQLServerInstance.html
It states the following:
After Amazon RDS provisions your DB instance, you can use any standard
SQL client application to connect to the DB instance. In this topic
you connect to your DB instance by using either Microsoft SQL Server
Management Studio (SSMS) or SQL Workbench/J.
Also double check that the RDS instance is on a public subnet and that you have allowed public access to it. See those settings in Configure Advanced Settings:

GCE instance to copy data from a different GCE MySQL database to Google CloudSQL

This may sound stupid and it is. But i'm wondering if it is possible to create a GCE instance that its sole purpose is to copy data from another GCE's MySQL database and copies all data to a Google Cloud SQL instance every few minutes and essentially updates the GCloud SQL.
Essentially i'm trying to get around how GAE can't connect to a GCE MySQL database but you can connect to a Google cloud SQL database.
I have tried "FEDERATED Tables" however Google Cloud SQL doesn't support that. So this is my last resort.
Thanks
Why do you need the GCE database at all? That is, why can't you just use a Cloud SQL database for all of your database needs?
You could try manually replaying the binary log to your Cloud SQL instance, ie:
Enable binary logging on your GCE MySQL instance.
Use mysqlbinlog to periodically extract the latest contents of the log as SQL statements. Use the positioning functions to make sure each run starts where the last finished.
Send the SQL outputted by mysqlbinlog to your Cloud SQL instance.