MySQL is the most widely used web-based database application (or client and server application, if you prefer) and powers millions of websites, and it’s currently free, although it’s not certain how long it will remain free. During the early years of MySQL it lacked certain important features, such as being able to self-join a table, but these days it offers so much and has so few weaknesses that it has become the standard in the web development industry.
PHP exec() command is heavily used, but sometimes when using mysqldump and other commands the results can be confusing and difficult to debug.
Namely, when tables are crashed, exec()’s $retVal might end up as either 2 or 3, and the table may or may not show as Crashed when doing a “SHOW TABLE STATUS”. Try to do a mysqldump, and look at the very end of the file to check for an error. Alternatively, just attempt to REPAIR TABLE on the table after the last table it successfully backed up.
It is best to always treat any value in $retVal as an error.
Crons can solve a lot of problems, but they can also create a lot of problems so be careful.
Usually you’ll make a cron to fix a specific problem, or to create a queue. There aren’t a whole lot of “standard” crons that we can discuss. (more…)
It’s a wonderful thing. Queues are a great way to deal with performance issues. Generally, from an end-user perspective they make the system appear to work very quickly.
This is #2 in our series because if you are searching for information on performance fixes, chance’s are you need a quick fix of some type. Queues are a great quick fix, they are also suitable for long-term implementation, and can solve a variety of problems, however they are only useful in certain situations so don’t get overzealous. (more…)
When trying to optimize the performance of your MySQL database, the first thing you try is often the most futile:
We put this first because it’s often the first “fix” people arrive at when trying to fix performance problems, but we think it’s almost never the solution, so we want to get that out of the way first. Generally speaking, most Mysql tables are created in a very optimum way. 5-10 years ago that wasn’t necessarily the case, however these days most problems are caused at the application-level or table-desgin-level (aka. Improper use of tables or improper table structure). It might be worthwhile to skip this article, but it’s a good idea to keep Table Optimization in mind, just don’t assume that’s going to be some magical fix. (more…)
MySQL is the subject of a common debate: How to pronounce it properly. The proper pronunciation of MySQL is:
Many people use the short-hand version
This is 100% wrong, and the only correct way to say it is the first way – “My S-Q-L”.
Okay, if you are frustrated with what I’ve said, just calm down and realize the sarcasm. Nobody cares how you pronounce it, there is no “correct” way, just say it how you wanna say it.
I love lamp.
LAMP programming has been around for many years. Although there are many variations, it normally stands for:
Linux Apache Mysql Php
Through the years, there have been many variations. For a long time, until PHP became popular, the P stool for Perl. Some people might argue that the P stands for Python. Eh, not really, PHP is much, much more widely used. (more…)
If you’re problem is your SQL, chances are you’re going to go about fixing it the wrong way. What is the “wrong way”? Trying to optimize Mysql settings is often a sign that you’re heading in the wrong direction. What should you do? Look at your SQL. Yes, just look at it.
That’s assuming you know what SQL is the problem. If you aren’t quite sure, try looking into Mysql’s Slow Query Log. Also use “mysql -e” or “mysqladmin processlist”. Maybe even make a cron to monitor this so you can go back and look at the logs. Bottom line: figure it out yourself, that’s not for this article. (more…)
“Deprecated” is a term used in programming to describe when a function or other feature should no longer be used.
Because of the fact that the term “deprecated” is fairly industry-specific to programming, we choose instead to call it “decapitated”. We think this is a more accurate description.
“Deprecated ” is often used in PHP because of he numerous iterations PHP has gone through. PHP describes many functions as deprecated because they were used in PHP 4 but were dumped in PHP 5. PHP also has many significant upgrades between version – subversions that have many more differences than average. PHP 5.3 is a great example of this, but there are many more significant sub-versions. (more…)
Some people ask “How do I use PHP and MySQL to create a mobile app?”.
You might be asking this because you are a programmer who wants to streamline their apps as much as possible and put some of the workload on your server. Maybe you are new to programming and want to use your newly honed PHP/MySQL skills. Or may you are a business manager who doesn’t want your programmers to waste a bunch of time learning new languages. (more…)
MySQL thankfully has a built-in data type called “FULLTEXT”.
For a long time, it did not have a native keyword search engine (ie. natural language search). We’ve seen a lot of functionality become easier and more standard thanks to the introduction of FULLTEXT several years ago.
With a MySQL FULLTEXT column, all words greater than a certain length (default: 3 characters) are included in a keyword index. Some very common words are excluded. MySQL keeps a very efficient index of these keywords, and searching these fields can be much faster than using a LIKE or LOCATE() command.
To search a FULLTEXT column, you must use the MATCH AGAINST clause in MySQL:
MATCH (columnA, columnB) AGAINST ("keyword keyword2") (more…)