Showing entries 8113 to 8122 of 44045
« 10 Newer Entries | 10 Older Entries »
Comment on SQL Injection with MySQL SLEEP() by Jan Steinman

Unless you are using an interface that allows multiple statements, you are safe from that subset of injection attacks, no? For example, the PHP mysql() interface and the default mysqli() interface does not allow multiple statements, so it would seem queries with a semicolon injected would simply fail.

Of course, using “OR SLEEP()” could still cause you trouble…

Also one defense Janos does not mention is to always make sure the MySQL user has no higher permissions than necessary. Little Bobby Tables could not cause such havoc unless the MySQL user running the query had DROP permission — which it seems would be very rare a need. 99% of database access will only need SELECT permission, and 99% of the remaining 1% should not need DROP permission!

Remember, MySQL “users” are really roles, not actual user logins.

How to get maximum key value of array in PHP

Sometimes you need to get maximum key value of your array but you try to get with loop and any function etc but in bellow example you can see we can get biggest key value from our php array by using max and arraykeys So lets try to use in your code this waystrongExamplestrongpre

GROUP BY, are you sure you know it?

 New MySQL version, YAY!

MySQL 5.7 is full of new features, like virtual columns, virtual indexes and JSON fields! But, it came with some changes to the default configuration. When running:

SELECT @@GLOBAL.sql_mode;

We get:

ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

What I want to talk about is the ONLY_FULL_GROUP_BY mode. This mode rejects queries where nonaggregated columns are expected, but aren't on the GROUP BY or HAVING clause. Before MySQL 5.7.5, ONLY_FULL_GROUP_BY was disabled by default, now it is enabled.

You know the drill...

This is a simple statement, people use it everywhere, it shouldn't be that hard to use, right?

Given the following schema:

--
-- Table structure for …
[Read more]
Sometimes a Variety of Databases is THE Database You Need

We were just leafing through the 2015 edition of The DZone Guide to Database and Persistence Management, and we noticed some interesting stats in the guide's included survey, about which we'd like to share some observations. The survey is one of the ebook's central features, and it includes feedback from over 800 IT Professionals, with 63% of those respondents coming from companies with over 100 employees and 69% with over 10 years of experience -- they represent a significant and important cross-section of our industry.

These kinds of reports can be enlightening, as they offer the opportunity to take some of our principles and pin them to the hard facts and numbers of actual database activity, in the field. 

In a section titled "One Type of Database is Usually Not Enough," the report reveals that it's stadard …

[Read more]
SQL Injection with MySQL SLEEP()

Recently we’ve received an alert from one of our clients that running threads are high on one of their servers. Once we logged in, we noticed that all the selects were waiting for table level read lock. We scrolled through the process list, and found the selects which were causing the problems. After killing it, everything went back to normal.
At first we couldn’t understand why the query took so long, as it looked like all the others. Then we noticed, that one of the WHERE clauses was strange. There, we found a SLEEP(3) attached with OR to the query. Obviously, this server was the victim of a SQL injection attack.

What is SQL injection?

I think most of us know what SQL injection is, but as a refresher, SQL injection is when someone provides malicious input into WHERE, to run their own statements as well.
Typically this occurs when you ask a user for input, like username, but instead of a real name they give you a …

[Read more]
Taking the new MySQL 5.7 JSON features for a test drive

MySQL 5.7 introduces both a new native JSON datatype, and a set of SQL functions to be able to manipulate and search data in a very natural way on the server-side. Today I wanted to show a simple of example of these features in action using sample data from SF OpenData.…

How MaxScale monitors servers

In this post, we’ll address how MaxScale monitors servers. We saw in the

We saw in the previous post how we could deal with high availability (HA) and read-write split using MaxScale.

If you remember from the previous post, we used this section to monitor replication:

[Replication Monitor]
type=monitor
module=mysqlmon
servers=percona1, percona2, percona3
user=maxscale
passwd=264D375EC77998F13F4D0EC739AABAD4
monitor_interval=1000
script=/usr/local/bin/failover.sh
events=master_down

But what are we monitoring? We are monitoring the assignment of master and slave roles inside MaxScale according to the actual replication tree in the cluster using the …

[Read more]
MariaDB itself is NOT affected by the DROWN vulnerability

Recently a serious vulnerability called DROWN was found. The vulnerability exists in systems that support SSLv2. There is flaw in SSLv2 that could be used to decrypt information over newer SSL protocols such as TLS. More information about the DROWN vulnerability with CVE number CVE-2016-0800 can be found here: The DROWN attack Mitre CVE dictionary […]

The post MariaDB itself is NOT affected by the DROWN vulnerability appeared first on MariaDB.org.

Example of unionAll in Query Builder Laravel

Sometimes you need to bind multimple query then you can use unionAll in laravel If you use union all then laravel query builder provide unionAll method for mysql union when you are doing big project or ERP level project then mostly you require to use union for getting data from database with multi

Laravel Join with Subquery in Query Builder Example

In this post i want to show you how to use subquery with join in laravel query builder Whenever you need to use subquery in your laravel project you can use following example and learn hot to use subquery In bellow example you can see we add subquery using DBraw DBraw throught we can sele

Showing entries 8113 to 8122 of 44045
« 10 Newer Entries | 10 Older Entries »