Sometimes we need to fire trigger like after delete update some fields of another tables for example if you have chatmessage tables and when remove row on this table then we need to update removecounterremovecounter 1 on users table i did give you bellow example you can see how to write t
Sometimes we need to fire trigger like after delete update some fields of another tables for example if you have chatmessage tables and when remove row on this table then we need to update removecounterremovecounter 1 on users table i did give you bellow example you can see how to write t
When you are working php or net etc and you return data like jsonencodedata on ajax request but in front side you get like a string at that time you have to parse json object and get them so lets see example and learn how to usestrong classexampleExamplestrong pre classprettyp
If you are work on laravel 5 application and you require to get user agentuser agent mean user browser details like firefox cherome etc then you can get easy you dont need to use SERVER variable like native PHP but laravel 5 provide Request facade you can fetch easy using following example
You may want to dump diagnostic information about the running
MySQL Database.
For MySQL 5.7, the SYS schema comes with the installation.
You can find the corresponding information on
https://dev.mysql.com/doc/refman/5.7/en/sys-diagnostics.html
For MySQL 5.6,the SYS schema can be downloaded from the following
URL https://github.com/mysql/mysql-sys
The zip file as ‘mysql-sys-master.zip’ is expanded, where the
sys_56.sql can be loaded into the MySQL 5.6 database.
# mysql -uroot -h127.0.0.1 < sys_56.sql
Using MySQL Workbench and connecting to the Server, you can find
the SYS schema installed.
Running the “diagnostics” stored procedure : …
To synchronize the data between the Galera Cluster and a new or re-entering Galera node Galera Cluster uses 2 different mechanisms:
- For full synchronization of data: Snapshot State Transfer (SST).
- For delta synchronization of data: Incremental State Transfer (IST).
The Incremental State Transfer (IST) is relevant when a node is already known to the Galera Cluster and just left the cluster short time ago. This typically happens in a maintenance window during a rolling cluster restart.
The Galera Cache is a round-robin file based cache that keeps all the write-sets (= transactions + meta data) for a certain amount of time. This time, which should be bigger than your planned maintenance window, depends on the size of the Galera Cache (default 128 Mbyte) and the traffic which will happen during your maintenance window.
If your traffic is …
[Read more]As per a related post from last week, we’re looking forward to Percona Live 2016 in Santa Clara, the go-to conference for MySQL & MongoDB users in particular, and open source database enthusiasts in general.
This year we’ve been given the opportunity to conduct a one-day tutorial based on our popular blog series ‘Become a MySQL DBA’. We’re reaching our 20th post in this series (the latest one is on trouble-shooting with pt-stalk) and are excited to be able to share that content and knowledge during this one day session in Santa Clara this month.
Art van Scheppingen
Our colleagues Art van Scheppingen and Ashraf Sharif will be walking participants through the content and practical exercises for about 6 hours spread across day 1 at Percona Live. The tutorial is scheduled to take place in Ballroom H. For …
[Read more]See Bill Nye the Science Guy at Percona Live Data Performance Conference, and help an excellent cause!
The best science is built on solid data. As a world-renown icon in tech and geek circles everywhere, Bill Nye fights to raise awareness of the value of science, critical thinking, and reason. He hopes that the data he brings will help inspire people everywhere to change the world. And seeing as the open source community is full of science-minded individuals, he is excited to speak to everyone at Percona Live!
Since his early days as a comedian, to creating his well-known …
[Read more]
The optimizer in MySQL 5.7 leverages generated columns. Generated
columns will physically store data in two cases: Either the
column is defined as STORED or you create an index on a virtual
column. The optimizer will leverage such an index automatically
if it encounters the same expression in a statement. Let's see an
example:
mysql> DESC squares;
+-------+------------------+------+-----+---------+-------+
| Field |
Type
| Null | Key | Default | Extra |
+-------+------------------+------+-----+---------+-------+
| dx | int(10) unsigned | YES
| | NULL
| |
| dy | int(10) unsigned | YES
| | NULL
| |
…
Update: Starting with MySQL 8.0.16 we do have CHECK constraints
implemented in SQL! See here.
During our recent TechTour event the idea came up to implement
JSON document validation not necessarily via foreign keys (as I
have shown here) but to define the generated column as
NOT NULL. The generation expression must be defined in a way that
it returns NULL for invalid data.
DISCLAIMER: This has already been explored by yoku0825 in his blogpost. He deserves all
credit!
Let's do a short test:
mysql> CREATE TABLE checker (
i int,
…