Showing entries 2391 to 2400 of 22222
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: MySQL (reset)
Simple KeepaliveD set up

So keepalived has been around for quite a while now .... however it is still a mystery to many.
So this is a very simple example of how keepalived can work with MySQL. Hopefully, this can help those with questions.

We will have a Simple master to slave set up. Meaning.. we write to one unless we have failover to the second for some event.

1st - install keepalived


# yum search keepalived keepalived.x86_64 : Load balancer and high availability service
  Name and summary matches only, use "search all" for everything. # yum -y install keepalived
You should now have an config file 
# ls -ltr /etc/keepalived/keepalived.conf 
Keep the original as you always backup .. right....

# cp /etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf.orig
So you need to figure out an ipaddress you can use for …

[Read more]
Putting the 'Fun' In Functional Indexes

I gave a thirty minute talk at Drupalcon this week on the features in MySQL 8.0 that would be of interest to developers and for such a short talk (and I cut slides to allow for audience questions) I could only cover the highlights. One attendee gently chastised me over no including their favorite new MySQL 8.0 feature -- functional indexes.


What is a Functional Index?
The manual says MySQL 8.0.13 and higher supports functional key parts that index expression values rather than column or column prefix values. Use of functional key parts enables indexing of values not stored directly in the table.   

There are some cool examples in the documentation on setting up some functional indexes, as can seen below.

CREATE TABLE t1 (
  col1 INT, col2 …

[Read more]
MySQL Tutorial: Create Database, Tables and Data Types

In this tutorial, you will learn about MySQL, how to create SQL databases, tables and various data types.

Prerequisites

You need to have MySQL server installed on your machine along with the MySQL client.

Create DATABASE | Create schema in MySQL

You can create a database in MySQL using the SQL instruction CREATE DATABASE .

Open a new terminal and invoke the mysql client using the following command: $ mysql -u root -p

Enter the password for your MySQL server when prompted.

You can now execute SQL statments. Let's see an example of creating a database named mydb: mysql> create database mydb;

Note: You can also use create schema for creating a database.

You can also add other parameters.

CREATE DATABASE IF NOT EXISTS

You can create multiple databases in your MySQL server. When using the IF NOT EXISTS parameter, you tell MySQL to create the …

[Read more]
MySQL InnoDB Cluster : avoid split-brain while forcing quorum

We saw yesterday that when an issue (like network splitting), it’s possible to remain with a partitioned cluster where none of the partition have quorum (majority of members). For more info read how to manage a split-brain situation.

If your read the previous article you notice the red warning about forcing the quorum. As an advice is never too much, let me write it down again here : “Be careful that the best practice is to shutdown the other nodes to avoid any kind of conflicts if they reappear during the process of forcing quorum“.

But if some network problem is happening it might not be possible to shutdown those other nodes. Would it be really bad ?

YES !

Split-Brain

Remember, we were in this situation:

We …

[Read more]
MySQL 8.0 Architecture and Enhancement Webinar: Q & A

In this blog, I will provide answers to the Q & A for the MySQL 8.0 Architecture and Enhancement webinar.

First, I want to thank everybody for attending my April 9, 2019, webinar. The recording and slides are available here. Below is the list of your questions that I was unable to answer fully during the webinar.

Q: What kind of Encryption levels does MySQL 8.0 provide?

The MySQL data-at-rest encryption feature supports the Advanced Encryption Standard (AES) block-based encryption algorithm and aes_256_cbc encryption algorithm for data at rest is hard coded.

Q: At what frequency does the redo log buffer flush the changes to disk? When is the commit variable set to zero?

Here’s an …

[Read more]
MySQL InnoDB Cluster – HowTo #1 – Monitor your cluster

MySQL InnoDB Cluster - HowTo #1 - Monitor your cluster

Q: How do I monitor the status & the configuration of my cluster?

A: Use status() or status({extended:true}) or status({queryMembers:true})?

MySQL InnoDB Cluster – how to manage a split-brain situation

Everywhere I go to present MySQL InnoDB Cluster, during the demo of creating a cluster, many people doesn’t understand why when I’ve 2 members, my cluster is not yet tolerant to any failure.

Indeed when you create a MySQL InnoDB Cluster, as soon as you have added your second instance, you can see in the status:

    "status": "OK_NO_TOLERANCE",      
"statusText": "Cluster is NOT tolerant to any failures.",

Quorum

Why is that ? It’s because, to be part of primary partition (the partition that holds the service, the one having a Primary-Master in Single Primary Mode, the default mode), your partition must reach the majority of nodes (quorum). In MySQL InnoDB Cluster (and many other cluster solutions), to achieve quorum, the amount of members in a partition must be > (bigger) than 50%.

So when we have 2 nodes, if there is a network issue between the …

[Read more]
SQL Where Clause Example | SQL Where Query Tutorial

SQL Where Clause Example | SQL Where Query Tutorial is today’s topic. The WHERE clause is used to filter the database records. The WHERE clause is used to extract only those records that fulfill the specified condition. The SQL WHERE clause is used to specify the condition while fetching the data from a single table or by joining the multiple tables. If a given condition is satisfied, then only it returns the specific value from the table. You should use a WHERE clause to filter the records and fetching the necessary records.

SQL Where Clause Example

The WHERE clause is not only used in the SELECT statement; it is also used in an UPDATE, DELETE statement. The syntax of a SELECT statement with a WHERE clause is following.

SELECT column1, column2, columnN 
FROM table_name
WHERE [condition]

“SELECT column1, column2, column3 FROM tableName” is the standard …

[Read more]
How to Add More Nodes to an Existing ProxySQL Cluster

In my previous post, some time ago, I wrote about the new cluster feature of ProxySQL. For that post, we were working with three nodes, now we’ll work with even more! If you’ve installed one ProxySQL per application instance and would like to work up to more, then this post is for you. If this is new to you, though, read my earlier post first for more context.

Check the image below to understand the structure of “one ProxySQL per application”. This means you have ProxySQL installed, and your application (Java, PHP, Apache server etc) in the same VM (virtual machine).

Having taken a look at that you probably have a few questions, such as:

  • What happens if you have 20 nodes …
[Read more]
Removal of implicit and explicit sorting for GROUP BY

In MySQL, historically GROUP BY was used to provide sorting as well. If a query specified GROUP BY, the result was sorted as if ORDER BY was present in the query.

mysql-5.7> CREATE TABLE t (id INTEGER,  cnt INTEGER);
Query OK, 0 rows affected (0.03 sec)

mysql-5.7> INSERT INTO t VALUES (4,1),(3,2),(1,4),(2,2),(1,1),(1,5),(2,6),(2,1),(1,3),(3,4),(4,5),(3,6);
Query OK, 12 rows affected (0.02 sec)
Records: 12  Duplicates: 0  Warnings: 0

mysql-5.7> SELECT id, SUM(cnt) FROM t GROUP BY id;
+------+----------+
| id   | SUM(cnt) |
+------+----------+
|    1 |       13 |
|    2 |        9 |
|    3 |       12 |
|    4 |        6 |
+------+----------+
4 rows in set (0.00 sec)

MySQL here implicitly sorts the results from GROUP BY (i.e.…

Facebook Twitter Google+ LinkedIn

Showing entries 2391 to 2400 of 22222
« 10 Newer Entries | 10 Older Entries »