Python -Run a transactional query in MySQL on Ubuntu No.103

How run a transactional query in MySQL on Ubuntu using Python is shown here. ▼1. Run a transactional query in MySQL on Ubuntu Regarding SQL Server on Ubuntu, how to execute a transactional query using Java and Python were shown in the past. regarding MySQL on Ubuntu, pyodbc is used for the connection to MySQL. autocommit setting in pyodbc is true by default to commit a transaction automatically. if autocommit is false, commit or rollback method is needed to control transaction. ▼2. Prerequisites How to create an environment to run python code for MySQL is shown in this blog. Python – Connect to MySQL on Ubuntu 20.04 by pyodbc No.98 … Continue reading “Python -Run a transactional query in MySQL on Ubuntu No.103”

Python – Put data in MySQL into Azure Blob Storage No.102

How to put the results of select query for MySQL into Azure Blob Storage using Python is shown in this blog. ▼1. Saving data in MySQL into Azure Blob Storage In the past, how to save data in MySQL into a local file using Python was shown in the following blog. in this case, the target of saving data is Azure Blob Storage. Python – Save data of MySQL into a local file  No.99 ▼2. Prerequisites How to create an environment to run python code for MySQL is shown in this blog. Python – Connect to MySQL on Ubuntu 20.04 by pyodbc No.98 ▼3. Python code to save data in … Continue reading “Python – Put data in MySQL into Azure Blob Storage No.102”

Python – Error handling & Retry in MySQL on Ubuntu  No.101

How to implement the error handling and retry with some interval in MySQL on Ubuntu by Python is shown in this blog. ▼1. Why do we need an error handling and an retry logic? We often use a cloud service and a remote service through the network. if the network intermittently cause something problems, the client application cannot access these services and will stop. to avoid this case, we need to add an error handling and an retry logic in an client application. ▼2. Prerequisites An error handling and a retry logic will be added into the code that was shown in the following blog. Python – Connect to MySQL … Continue reading “Python – Error handling & Retry in MySQL on Ubuntu  No.101”

Python – Save data of MySQL into a local file  No.99

How to save the results of select query in MySQL on Ubuntu through pyodbc into a local file using python is shown in this blog. ▼1. Save data of MySQL on Ubuntu into a file In the past, how to save data My MySQL into a file using Java was provided in this blog as below. in this case, it will be implemented by Python. Java -Save the results of select for MySQL into a file No.85 ▼2. Prerequisites How to create an environment to run python code for MySQL is shown in this blog. Python – Connect to MySQL on Ubuntu 20.04 by pyodbc No.98 ▼3. Python code to save … Continue reading “Python – Save data of MySQL into a local file  No.99”

Python – Connect to MySQL on Ubuntu 20.04 by pyodbc No.98

How to connect to MySQL by pyodbc and run select statement using Python is shown in this blog. ▼1. Connecting to MySQL by pyodbc Python In the past blogs, how to connect to MySQL using Java is provided as below. in this blog, the connection to MySQL by pyodbc using Python is written. (2022/12 時点)Java –Save records for MySQL into Azure Blob Storage No.86 Java -Save the results of select for MySQL into a file No.85Java – Connect to MySQL on Ubuntu and run select query No.80 ▼2. Prerequires 2-1. Installing MySQL on Linux Ref: Java – Connect to MySQL on Ubuntu and run select query No.80 ”2-6. installing mysql java connector” 2-2. Installing MySQL の … Continue reading “Python – Connect to MySQL on Ubuntu 20.04 by pyodbc No.98”

Java –Save records for MySQL into Azure Blob Storage No.86 

In this blog, how to save the results of select query for MySQL into Azure Blob Storage by Java. ▼1. Prerequisites 1-1. Install MySQL and create a table with some records Java – Connect to MySQL on Ubuntu and run select query No.80 # Create a table with some records mysql> CREATE DATABASE testdb; mysql> USE testdb; mysql> create table testtbl (c1 int, c2 int); mysql> insert testtbl values(1,1),(2,2),(3,3); mysql> select * from testtbl; +——+——+ | c1 | c2 | +——+——+ | 1 | 1 | | 2 | 2 | | 3 | 3 | +——+——+ 3 rows in set (0.00 sec) ▼2. Save the results of select for … Continue reading “Java –Save records for MySQL into Azure Blob Storage No.86 “

Java -Save the results of select for MySQL into a file No.85

In this blog, how to save the results of select for MySQL on Ubuntu into a file is shown. ▼1. Prerequisites 1-1. Install MySQL and create a table with some records Java – Connect to MySQL on Ubuntu and run select query No.80 # Create a table with some records mysql> CREATE DATABASE testdb; mysql> USE testdb; mysql> create table testtbl (c1 int, c2 int); mysql> insert testtbl values(1,1),(2,2),(3,3); mysql> select * from testtbl; +——+——+ | c1 | c2 | +——+——+ | 1 | 1 | | 2 | 2 | | 3 | 3 | +——+——+ 3 rows in set (0.00 sec) ▼2. Save the results of select for … Continue reading “Java -Save the results of select for MySQL into a file No.85”

Java – Connect to MySQL on Ubuntu and run select query No.80

How to connect to MySQL and run select query is shown in this blog. ▼1. What is MySQL? MySQL, the most popular Open Source SQL database management system, is developed, distributed, and supported by Oracle Corporation. MySQL is available on some cloud services such as Azure, AWS, Oracle etc. ▼2. Prerequisites 2-1. Install JDK Install Java 8 openjdk x64 of zulu Set environment variables Use vi editor like “vi ~/.bashrc” and add below in ~/.bashrc export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-x64/ Check the value of $JAVA_HOME 2-2. Install Visual Studio Code https://code.visualstudio.com/docs/setup/linux 2-3. Install Maven Apache Kafka Word Count – Java No.44 “2-3. Installing Apache Maven” 2-4. Install the latest version of MySQL # … Continue reading “Java – Connect to MySQL on Ubuntu and run select query No.80”