Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Previous 30 Newer Entries Showing entries 61 to 90 of 867 Next 30 Older Entries

Displaying posts with tag: PHP (reset)

Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Scientific Linux 6.3
+0 Vote Up -1Vote Down

Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Scientific Linux 6.3

Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on a Scientific Linux 6.3 server with PHP5 support (through PHP-FPM) and MySQL support.

Installing Apache2 With PHP5 And MySQL Support On Scientific Linux 6.3 (LAMP)
+0 Vote Up -0Vote Down

Installing Apache2 With PHP5 And MySQL Support On Scientific Linux 6.3 (LAMP)

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on a Scientific Linux 6.3 server with PHP5 support (mod_php) and MySQL support.

OpenVZ and Amazon S3: how to solve the dreaded connection throttle failure
+0 Vote Up -0Vote Down

Sometimes we encounter odd application responses that seem to make no sense. One of these such issues is related to running virtual server instances (OS Containers not Para-Virtualized VMs) and attempting to back up their data to Amazon’s S3 cloud storage. For moderately sized virtual machines running MySQL databases or Python/PHP based websites and code repositories this can be an inexpensive, quickly provisioned, and easy way to provide disaster recovery backups in numerous geographic locations, since we generally want DR content to be located in a physically distant location. Nevertheless, we can encounter errors if using an S3 mount in a distance location from our server if the timezone/sync data is incorrect.

The commonly seen error is as follows – and it doesn’t give much information for

  [Read more...]
Secrets of mysqlnd Presentation
+1 Vote Up -1Vote Down

Download PDF Presentation

At the recent New York PHP Group in New York, I gave a presentation on “Secrets of mysqlnd”. While there are no real “secrets” of the new MySQL Native Driver for PHP, available in PHP 5.3, and the default for PHP 5.4+ replacing libmysqlclient, there are new features of the driver many are unaware of. If you have ever had to fight the gods with compiling a particular version of PHP with the right libmysqlclient dependency, the good news is that legacy requirement is no longer necessary.

Some of the topics discussed in detail


  [Read more...]
PECL/mysqlnd_ms 1.5 + PHP 5.5.0 + MySQL 5.6 = better load balancing
Employee +2 Vote Up -0Vote Down

PECL/mysqlnd_ms is a client-side load balancer for PHP that supports any MySQL cluster. It does read-write splitting, failover, introduces a quality of service concept, supports partitioning and, of course, load balancing. New mysqli API (begin, *savepoint) calls in PHP 5.5.0 help to improve transaction awareness. New read only in MySQL 5.6 promise major performance gains (think 2x) and an option to reduce the load on a MySQL Replication master. Read how the features go together in PECL/mysqlnd_ms 1.5.

Load balancing – transaction aware?

A load balancer must not switch connections in the middle of a transaction. A load balancer must send all queries to the server a transaction has been started on until the transaction ends. Unfortunately, it is very hard to

  [Read more...]
[updated] Free book February returns – Get a copy of the InnoDB Quick Reference Guide
+0 Vote Up -0Vote Down

This month is a special month. It’s not because of President’s Day or even the exciting day where we revel in groundhogs. No, this month is special because the free book give-away is happening again. This is where you, the reader, gets to win something free for doing nothing more than posting a comment saying that you want a copy of my recently published book – The InnoDB Quick Reference Guide from Packt Publishing. The book is a great reference for DBAs, PHP, Python, or Perl programmers that integrate with MySQL and want to learn more about the InnoDB database engine.

So, all you have to do is post a comment here saying that you want a copy and write out a single (or more) sentence about how you use InnoDB in your

  [Read more...]
Installing Lighttpd With PHP5 (PHP-FPM) And MySQL Support On Fedora 18
+0 Vote Up -0Vote Down

Installing Lighttpd With PHP5 (PHP-FPM) And MySQL Support On Fedora 18

Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on a Fedora 18 server with PHP5 support (through PHP-FPM) and MySQL support. PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. I use PHP-FPM in this tutorial instead of Lighttpd's spawn-fcgi.

The InnoDB Quick Reference Guide is now available
+3 Vote Up -0Vote Down

I’m pleased to announce that my first book, the InnoDB Quick Reference Guide, is now available from Packt Publishing and you can download it by clicking here. It covers the most common topics of InnoDB usage in the enterprise, including: general overview of its use and benefits, detailed explanation of seventeen static variables and seven dynamic variables, load testing methodology, maintenance and monitoring, as well as troubleshooting and useful analytics for the engine. The current version of MySQL ships with InnoDB as the default table engine, so whether you program your MySQL enabled applications with PHP, Python, Perl or otherwise, you’ll likely benefit from this

  [Read more...]
Learn to Develop Dynamic Web Applications with PHP and MySQL
Employee_Team +2 Vote Up -0Vote Down

Learn to create best-of-breed web applications with the MySQL and PHP - Developing Dynamic Web Applications course

After taking this course you will be able to:

  • Describe the LAMP architecture
  • Use the basic components of PHP to build a foundation for more complex web applications
  • Understand the basic components of MySQL
  • Use SQL query commands to retrieve data from the MYSQL database
  • Change table data using the SQL Data Manipulation Language (DML) commands
  • Retrieve data from multiple MySQL tables using Joins
  • Create web based forms that interact with the end user and the data within MySQL
  • Use session handling to
  [Read more...]
Poor programming practices
+3 Vote Up -2Vote Down

When will it stop. These amateur programmers that simply cut/paste code really affect those good programmers in the ecosystem trying to make a decent living. I was reviewing a developed (but incomplete) PHP/MySQL system using a common framework (which in itself is irrelevant for this post).

In one source file there were 12 repetitions of the following code:

   //permissions
    $this->security_model->setUserPermissions($id);
    if (!array_key_exists($id,$this->session->userdata['permissions']) OR
	!array_key_exists('id', $this->session->userdata['permissions'][$id]) OR
	!array_key_exists('scope', $this->session->userdata['permissions'][$id]['name'])){
      $this->session->set_flashdata('alert', 'You are not authorized to go there.');
      redirect($this->agent->referrer());
    }

It’s bad enough when code

  [Read more...]
Common Lookup Tables 2
+1 Vote Up -0Vote Down

Last October I posted an example and description of a common_lookup table. It was intended to show how common_lookup tables support drop down selections in web forms. However, it wasn’t adequate to show how they work with existing data, and the function only supported fresh queries.

This post goes to the next level, and shows how to use foreign keys to preselect values for display in web forms. It also rewrites the prior function so that it supports querying existing data and inserting new data.

Let’s start with data stored in join between two tables – the member and contact tables. The internal lookup uses the customers name from the contact table to find the membership account information in the

  [Read more...]
1.5x … 9x faster queries with PHP and MySQL 5.6, really?
Employee +0 Vote Up -0Vote Down

I am telling no secret saying MySQL 5.6 GA can be expected to be released soon, very soon. Time to test one of the improvements: MySQL 5.6 speaks SQL and Memcache protocol. In your PHP MySQL apps, try using the Memcache protocol to query MySQL. A key-value SELECT ... FROM ... WHERE pk = <key> can become 1.5x-2x faster, an INSERT INTO table(pk, ...) VALUES (<key> ...) can become 4.5x-9x faster, says the InnoDB team! Read on: background, benchmark, usage, PECL/mysqlnd_memcache,

  [Read more...]
Installing Apache2 With PHP5 And MySQL Support On Fedora 18 (LAMP)
+0 Vote Up -0Vote Down

Installing Apache2 With PHP5 And MySQL Support On Fedora 18 (LAMP)

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on a Fedora 18 server with PHP5 support (mod_php) and MySQL support.

Read/Write Splitting with PHP Webinar Questions Followup
+1 Vote Up -0Vote Down

Today I gave a presentation on “Read/Write Splitting with PHP” for Percona Webinars.  If you missed it, you can still register to view the recording and my slides.

Thanks to everyone who attended, and especially to folks who asked the great questions.  I answered as many as I could during the session, but here are all the questions with my complete answers:

Q: I wasn’t able to start up the webinar until it was 20 minutes in progress. Is it possible to get a recording once it is over?

A: Yes, we will email a link to all webinar attendees with a recording of the webinar and a link to the slides within 24 hours.  Folks who did not attend the webinar can also visit the webinar

  [Read more...]
Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Fedora 18
+0 Vote Up -0Vote Down

Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Fedora 18

Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on a Fedora 18 server with PHP5 support (through PHP-FPM) and MySQL support.

Webinar on PHP and MySQL Replication
+2 Vote Up -0Vote Down
Using MySQL replication gives you an opportunity to scale out read queries. However, MySQL replication is asynchronous; the slave may fall behind. This Wednesday, January 23 2013, I'll be presenting a free webinar about using MySQL replication on busy PHP web sites.  Register here:  http://www.percona.com/webinars/readwrite-splitting-mysql-and-php Applications have variable tolerance
Take the Authentic MySQL for Developers Training Course
Employee_Team +4 Vote Up -0Vote Down

The authentic MySQL for Developers course will introduce you to tools used by MySQL development professionals and you get the opportunity to work through examples specific to Java and PHP development cases.

In this course you will learn to:

  • Use MySQL tools to connect to databases.
  • Examine database structure and contents.
  • Generate database structure diagrams.
  • Execute complex queries.
  • Manipulate numeric, text, spatial and temporal data.
  • Execute complex subqueries and joins.

You can take this 5 day live-instructor course via these two delivery methods:

  • Live-Virtual Class: Take this class from your own desk by choosing from the many events already on the
  [Read more...]
Solution for: MySQL 5.6 password expired, PHP can’t connect, application stops
Employee +1 Vote Up -0Vote Down

MySQL 5.6 introduces a new features that must be used with great care. A MySQL users password can be marked as expired. This way, a DBA can force a user to set or reset his password. The MySQL user must set a (new) password before he is allowed to do anything else. As a consequence, if a users password is expired all standard PHP MySQL API connect calls will fail. Applications stop working unless the application is changed to include a user dialog for setting a new password. To develop such a dialog for resetting an expired password one has to use a new connection flag introduced in PHP 5.4.12-dev. Don’t panic: to get in trouble DBA actions have to be at one level with dropping the MySQL user of a production PHP application…

Relax: IF MySQL 5.6 AND IF …AND IF  [Read more...]

PECL/mysqlnd_ms and the client failover dilemma – part 1
Employee +0 Vote Up -0Vote Down

MySQL Replication has a weak point: the master (primary) is a single point of failure. People ask frequently about client failover. Making a client library failover a client automatically from one server to another is simple. PECL/mysqlnd_ms can do it. Unfortunately, this is only the tip of the iceberg when using a primary copy (master-slave) database cluster. Among others, you may have to reconfigure clients. Below is one hint (no solution) for deploying PECL/mysqlnd_ms configuration files using MHA (Master High Availability Manager and tools for MySQL).

What’s the plural of dilemma?

If a server is unavailable a client may attempt to connect to another server given a list of alternatives. A client library can handle it entirely

  [Read more...]
Questions about the MariaDB C Connector
+5 Vote Up -1Vote Down
I should first start this blog post with the acronym IANAL (I am not a lawyer).  Also the views in this post are mine and not my employer's (a lawyer did ask me to say that part).

Questions on the MariaDB JDBC Driver have already been raised so I wanted to do something similar for the MariaDB C Connector.  The JDBC's issues are mostly ethical whereas my C Connector questions are mostly legal.

But first a little history...  MySQL 3.23.58 was the last version to include an LGPL licensed connector for MySQL, the connector went GPL (and of course commercial) after this version.  Nowadays the connector is GPL with a FLOSS exception, that exception allows you to compile with certain other licensed software.  The main



  [Read more...]
Some sharding support and cache locality optimization support for PHP MySQL driver
Employee +5 Vote Up -0Vote Down

It is time for christmas presents: some sharding support and cache locality optimizations are coming with PECL/mysqlnd_ms 1.5. PECL/mysqlnd_ms is a plugin for the mysqlnd library. The plugin adds replication and load balancing support to any PHP MySQL API (mysql, mysqli, PDO_MySQL) if compiled to use the mysqlnd library.

As a MySQL user you can choose between a wide variety of clustering solutions to scale-out. Your options range from eventual consistent solutions to strong consistent ones, from built-in (MySQL Replication, MySQL Cluster) to third party or home-grown. PECL/mysqlnd_ms is a client side load

  [Read more...]
Switching to PHP 5.4 on OS X
+0 Vote Up -0Vote Down

I like using OS X's built-in packages where possible, but unfortunately Apple is way behind with their PHP package, having it locked on 5.3.15. In the past I've seen people use tools like Mamp, or Xampp to provide this for them, but frankly I'm not a big fan of these tools.

Homebrew provides a solution. Homebrew is OS X missing package manager, and it's an absolute great tool to work with. Getting started with it is a bit harder, as there's a few bigger dependencies you need, such as an up-to-date XCode installation. Once you've installed homebrew, it's a matter of running the following commands:

  • brew tap homebrew/dupes
  • brew tap josegonzalez/homebrew-php
  • brew install
  •   [Read more...]
    Prevent SQL Injection in PHP
    +0 Vote Up -0Vote Down

    Two easy ways to prevent SQL Injection in PHP

    To many people still execute sql queries using methods which does not prevent SQL Injection, and many tutorials out there give bad example of doing so.

    SQL Injection? What? -> SQL Injection explained

    There are two easy aproachs to prevent SQL Injection:

  • Using PDO:
    stmt = $pdo->prepare('SELECT * FROM employees WHERE name = :name'); 
    $stmt->execute(array(':name' => $name)); 
    foreach ($stmt as $row) {     
        // do something with $row 
    }
  • Using mysqli:
    $stmt = $dbConnection->prepare('SELECT

  •   [Read more...]
    Learn to Create Applications Using MySQL with MySQL for Developers Course
    Employee_Team +2 Vote Up -0Vote Down

    If you are a database developer who wants to create applications using MySQL, then the MySQL for Developers course is for you. This course covers how to plan, design and implement applications using the MySQL database with realistic examples in Java and PHP.

    To see more details of the content of the MySQL for Developers course, go to http://oracle.com/education/mysql and click on the Learning Paths tab and select the MySQL Developer path.

    You can take this course as a:

    • Live-Virtual Event: Follow this live instructor-led event from your own desk - no travel required. Choose from a selection of events on the calendar in languages such as English, German and Korean.
    • In-Class Event: Travel to an education center to take this class. Below is a sample of events on the schedule.
      [Read more...]
    Supercharging PHP MySQL applications using the best API
    Employee +3 Vote Up -0Vote Down

    PHP MySQL developers are confronted with three PHP MySQL APIs. That is confusing. Since mid 2012 the PHP manual suggests not to use the oldest and original PHP MySQL extension any more to cure the situation. Please, swap out ext/mysql in favour of either ext/mysqli or PDO_MySQL. Why to upgrade is below. Read on, if you are a PHP beginner, your PHP application is still using mysql_* functions of ext/mysql or you are a PHP trainer.

    As a PHP consumer, tease your software vendors by asking whether they use the state of the art APIs! Here is a cut&paste test question to ask your vendor: do you support secure SSL connections to MySQL?

    History  [Read more...]

    Power Dynamic Database-Driven Websites with MySQL & PHP
    Employee_Team +1 Vote Up -0Vote Down

    Join major names among MySQL customers by learning to power dynamic database-driven websites with MySQL & PHP.

    With the MySQL and PHP: Developing Dynamic Web Applications course, in 4 days, you learn how to develop applications in PHP and how to use MySQL efficiently for those applications! Through a hands-on approach, this instructor-led course helps you improve your PHP skills and combine them with time-proven database management techniques to create best-of-breed web applications that are efficient, solid and secure.

    You can currently take this course as a:

    • Live Virtual Class (LVC): There are a number events on the schedule to suit different timezones in January 2013 and March 2013. With an LVC, you get to follow this live instructor-led class from your own desk - so no travel expense or inconvenience.
      [Read more...]
    OpenCode: MySQL procedures + python + shell code repositories now public
    +1 Vote Up -0Vote Down

    I write a fair number of scripts on this site and have posted a lot of code over the years. Generally if I am not pasting the code to be viewed on the webpage then I link to a file that a user can download; which leads to a lot of mish-mash code that doesn’t have a home. I’ve always kept the code files in a private SVN repo over the years but have recently moved them all to BitBucket Git repositories. So here they are: lots of code samples and useful bits of programming to save time.

    Generic Shell Scripts: https://bitbucket.org/themattreid/generic-bash-scripts/src
    Generic Python Scripts: https://bitbucket.org/themattreid/generic-python-scripts/src
    Generic MySQL Stored Procs:

      [Read more...]
    Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support (LEMP) On Ubuntu 12.10
    +0 Vote Up -0Vote Down

    Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support (LEMP) On Ubuntu 12.10

    Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on an Ubuntu 12.10 server with PHP5 support (through PHP-FPM) and MySQL support (LEMP = Linux + nginx (pronounced "engine x") + MySQL + PHP).

    Installing Apache2 With PHP5 And MySQL Support On Ubuntu 12.10 (LAMP)
    +0 Vote Up -0Vote Down

    Installing Apache2 With PHP5 And MySQL Support On Ubuntu 12.10 (LAMP)

    LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on an Ubuntu 12.10 server with PHP5 support (mod_php) and MySQL support.

    Using lookup tables
    +1 Vote Up -0Vote Down

    My students wanted an example of how to use a lookup table in the database. I thought it would be a great idea to create a simple example like this one.

    A lookup table is a generalization that holds lists of values that support end-user selections. The following example uses a combination of the common_lookup_table and common_lookup_column columns to identify sets of value for drop down lists. The end-user selects a value from the list to identify a unique row, and returns a common_lookup_id surrogate key value.

    The sample code uses the table defined in the previous illustration. It uses a simple HTML drop down list, a PHP

      [Read more...]
    Previous 30 Newer Entries Showing entries 61 to 90 of 867 Next 30 Older Entries

    Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

    Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.