Showing entries 4986 to 4995 of 44868
« 10 Newer Entries | 10 Older Entries »
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

PHP, MySQL & React REST API Tutorial with Example Form

Throughout this tutorial, we'll be using PHP with React and Axios to create a simple REST API application with CRUD operations. In the backend we'll use PHP with a MySQL database.

The PHP backend will expose a set of RESTful API endpoints so we'll be using the Axios library for making Ajax calls from the React.js UI.

We'll also see how to handle forms in React and how to send multipart form data with Axios using FormData.

In this tutorial, we are going to integrate React with PHP using Babel in the browser and a <script> tag. As such, we'll serve the React application from PHP so we don't need to enable CORS in our server since both the backend and frontend are served from the same domain.

We'll see the other approach of using two separate servers for the frontend and backend apps in another tutorial which will use the create-react-app to create the React project.

Prerequisites

You must …

[Read more]
Sometimes the slow database.. is not the database...

So I was recently asked to look into why the updated MySQL 5,.6 was slower than the older 5.5 

So I started by poking around looking over the standard variables and caches and etc.

The test case was a simple routine that took about twice as long to run on 5.6 than it did on 5.5. 

To add to the mix.. the 5.6 version had double the Innodb_buffer_pool_size and of course more ram overall.  

So I started some tests with MySQLslap...

Mysqlslap tests show it slower on 5.6 

5.6:
mysqlslap --defaults-file=./.my.cnf --concurrency=150 --iterations=130 -query=/test.sql --create-schema=applicationdata --verbose 
Benchmark
Average number of seconds to run all queries: 0.028 seconds
Minimum number of seconds to run all queries: 0.019 seconds
Maximum number of seconds to run all queries: 0.071 seconds

[Read more]
Using MySQL Shell to create a three-node MySQL InnoDB Cluster

MySQL InnoDB Cluster was introduced in MySQL version 5.7 and consists of three parts – Group Replication, MySQL Shell and MySQL Router. MySQL InnoDB Cluster provides a complete high availability solution for MySQL. In this post, I am going to explain how to setup a three-node cluster using the MySQL Shell.

Note: Visit this page to learn more about …
[Read more]
Upcoming Webinar Wed 4/10: Extending and Customizing Percona Monitoring and Management

Please join Percona’s Product Manager, Michael Coburn, as he presents his talk Extending and Customizing Percona Monitoring and Management on April 10th, 2019 at 10:00 AM PDT (UTC-7) / 1:00 PM EDT (UTC-4).

Register Now

Do you already run stock PMM in your environment and want to learn how you extend the PMM platform? If so, come learn about:

1. Dashboard Customizations
* How to create a custom dashboard from existing graphs, or build Cross Server Dashboards
2. External Exporters – Monitor any service, anywhere!
* …

[Read more]
MySQL backup shell script with status email

This post is for the backup script for MySQL database on Linux with mail. It’s a linux shell script for taking logical backup using mysqldump and sending status email. The…

The post MySQL backup shell script with status email first appeared on Change Is Inevitable.

Upcoming Webinar Tues 4/9: MySQL 8.0 Architecture and Enhancement

Please join Percona’s Bug Analyst, Lalit Choudhary as he presents his talk MySQL 8.0 Architecture and Enhancement on Tuesday, April 9th, 2019 at 6:00 AM PDT (UTC-7) / 9:00 AM EDT (UTC-4).

Register Now

The release of MySQL 8.0 offers much more to users compared to previous releases. There are major changes in architecture as well as adding differentiating features, and improvements to manage the database more efficiently.

In our talk we will go through, MySQL 8.0 …

[Read more]
PHP PDO Tutorial: CRUD Example with MySQL

PDO stands for PHP Data Object and it's an extension that provides an interface for communicating with many supported popular database systems such as MySQL and Oracle, PostgreSQL and SQLite, etc.

It's provided starting with PHP 5.1.

Since PDO abstracts away all the differences between various database management systems, you only need to change the information about your database in your code in order to change the database system used in your PHP application.

Setting up PDO

PDO is added by default starting with PHP 5.1 but you need to set the necessary database driver in the php.ini file: extension=pdo.so extension=pdo_mysql.so

Creating a MySQL Database

Let's start by creating a MySQL using the mysql client. In your terminal, run the following command: $ mysql -u root -p

Enter your MySQL database password when prompted.

Next, run the following SQL instruction to create a …

[Read more]
Create PHP 7 MySQL Database Tables Using MySQLi & PDO

In this tutorial we'll learn how to use MySQLi and PDO to create MySQL database tables in PHP 7.

You can use the CREATE DATABASE SQL instruction to create a database in your MySQL client so let's start by creating a database. Open a new terminal and run the following command: $ mysql -u root -p

Enter your MySQL instance password when prompted.

Note: The official tool for working with MySQL is the mysql client which get installed when you install MySQL in your machine. The MySQL client can be used through your terminal as a CLI tool.

Next, you can run the following command to create a MySQL database: mysql> create database mydb;

That's it! We now have a database.

Let's now see how you can create a MySQL table using PHP, MySQLi and PDO.

The mysqli extension is a relational database driver that allows you to access the functionality provided by MySQL 4.1 and above in PHP. It stands …

[Read more]
Showing entries 4986 to 4995 of 44868
« 10 Newer Entries | 10 Older Entries »