Showing entries 1313 to 1322 of 44037
« 10 Newer Entries | 10 Older Entries »
OpenLampTech issue #51 – Substack Repost

This week’s OpenLampTech newsletter has a great mix of round-up posts for you across the PHP and MySQL backend web space. In just 1 more week, we are 1 year old! How nuts is that?!? Enjoy this week’s publication and share with others.

The Newsletter for PHP and MySQL Developers

Receive a copy of my ebook, “10 MySQL Tips For Everyone”, absolutely free when you subscribe to the OpenLampTech newsletter.

In OpenLampTech issue #51, we are looking at content covering:

  • WordPress keeps the lights on
  • PHP Readonly classes
  • Overview of the LOMP stack
  • Headless Drupal in the CMS space
  • And much much more

A free …

[Read more]
Seamless failover with Galera Load Balancer

Continuing on from Setting up Galera Load Balancer (GLB), wouldn’t it be nice to ensure that Galera Load Balancer (GLB) handles failover, seamlessly?

Router:
------------------------------------------------------
        Address       :   weight   usage    map  conns
188.166.179.177:3306  :    1.000   0.500    N/A      1
  165.22.50.152:3306  :    1.000   0.500    N/A      1
   165.22.49.92:3306  :    1.000   0.000    N/A      0
------------------------------------------------------
Destinations: 3, total connections: 2 of 493 max

Pool: connections per thread:     1     1     0     0     0     0

Here is an example of a Galera Load Balancer (GLB) handling 3 backend MySQL servers, and it currently has 2 connections, evenly distributed between 2 hosts.

We can verify this by doing: select @@hostname; which shows:

[Read more]
ProxySQL support for MySQL caching_sha2_password

In our time, every day we use dozens if not hundreds of applications connecting to some kind of data repository. This simple step is normally executed over the network and given so, it is subject to possible sniffing with all the possible related consequences.

Given that it is normally better to protect your connection using data encryption like SSL, or at the minimum, make the information you pass to connect less easy to be intercepted. 

At the same time it is best practice to not store connection credential in clear text, not even inside a table in your database. Doing that is the equivalent of writing your password over a sticky note on your desk. Not a good idea.

The main options are instead in either transforming the passwords to be less identifiable like hashing or to store the information in an external centralized vault. 

In MySQL the passwords are transformed in order to not be clear …

[Read more]
Raspberry on the Rocks: Build Percona Server for MySQL With MyRocks on Your Raspberry Pi

Raspberry PI is a small single-board computer (SBCs) developed by the Raspberry Pi Foundation in association with Broadcom. This tiny computer is extremely popular and widely used in many areas. Thanks to its size, low cost, and low energy requirements, it can be used to collect data in remote locations or from sensor devices. We often need to be able to store large amounts of data efficiently on these devices.

MyRocks is a MySQL engine that uses RocksDB to store data. It is space efficient and able to handle writes quite efficiently.

First things first

Building and installing Percona Server for MySQL with MyRocks engine enabled is easy but requires some time. It is essential to make sure that you have all the ingredients and meet all the requirements:

  • Raspberry PI 3, 4, 400, or superior.
  • SD Card with …
[Read more]
Set Theory in MySQL 8.0: UNION and Now INTERSECT and EXCEPT

Are you familiar with the UNION statement for your SQL queries? Most likely, you are. It has been supported for a long time.

In case you are not familiar with UNION, don’t worry, I’m going to show you how it works with simple examples.

Considering “Set Theory”, other than the UNION, starting from the newly deployed MySQL Community 8.0.31, a couple of new clauses are available: INTERSECT and EXCEPT.

From now on you can rely on more powerful options to write your queries and deploy some Set Theory logic.

In this article, I’m going to present how the three options work.

The traditional UNION

UNION combines the results from two or multiple SELECT statements into a single result set. Let’s suppose you have two queries, A and B, they return the same number of columns with the same data types and you need to merge all rows from both queries into a single result set. You can …

[Read more]
INTERSECT and EXCEPT commands in MySQL

MySQL now supports the INTERSECT and EXCEPT set operators. Set operators work on the results of multiple SELECT statements. In this post, we will see example queries using INTERSECT and EXCEPT commands for a better understanding

The Newsletter for PHP and MySQL Developers

Receive a copy of my ebook, “10 MySQL Tips For Everyone”, absolutely free when you subscribe to the OpenLampTech newsletter.

While MySQL has supported UNION and UNION ALL commands, there were no INTERSECT or EXCEPT commands in the language. This often involved work-around queries. However, MySQL now does support the INTERCEPT and EXCEPT set operators.

For the example queries, I am using 2 simple tables with arbitrary data.

The names …

[Read more]
How to Generate Test Data for MySQL With Python

For testing purposes, especially if you’re working on a project that uses any database technology to store information, you may need data to try out your project. In that case, you have two options:

  • Find a good dataset (Kaggle) or,
  • Use a library like Faker

Through this blog post, you will learn how to generate test data for MySQL using Faker.

Requirements Dependencies

Make sure all the dependencies are installed before creating the Python script that will generate the data for your project.

You can create a requirements.txt file with the following content:

pandas
sqlalchemy
PyMySQL
tqdm
faker

Once you have created this file, run the following command:

pip install -r requirements.txt

Or if you’re using Anaconda, create an environment.yml file:

name: percona
dependencies:
  - python=3.10
  - pandas
  - sqlalchemy …
[Read more]
MySQL Integers: INT BIGINT and more

MySQL has a number of integer types, and while INT may seem like the right choice for most scenarios, it’s worth understanding what options you have so you can make the right choice when designing your database. In this article, we’ll take a look at the various integer types and take a deeper dive into how they are stored in MySQL. An overview of the MySQL INT type An integer is simply a whole number. It can be positive, negative, or even zero. In MySQL, there are actually several different data types you can use to store integers, each with its own range of numbers. The standards INT type can store up to 4,294,967,296 values including 0, and MySQL permits negative numbers by default unless otherwise specified. Defining an INT column looks like this in a CREATE TABLE statement:CREATE TABLE my_table ( my_integer_col INT );

Since MySQL defaults to allowing both negative and positive numbers, my_integer_col would be able to store whole …

[Read more]
MySQL Integers: INT BIGINT and more

Gain a deeper understanding of the MySQL integer types by exploring the different options (INT BIGINT MEDIUMINT etc) and how they are stored.

Coroot – The Next Level in Kubernetes Observability

To follow up on my previous Kubernetes articles:

I would like to introduce a project which brings Kubernetes observability to the next …

[Read more]
Showing entries 1313 to 1322 of 44037
« 10 Newer Entries | 10 Older Entries »