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 850 Next 30 Older Entries

Displaying posts with tag: PHP (reset)

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...]
    3 times speed increase with static pages
    +0 Vote Up -0Vote Down
    Internet was born from static pages. People were creating websites with emacs and vi. With increased popularity of scripting languages and open source databases like MySQL and Postgresql, more and more developers started to use these advanced tools. CMS systems were build. They made our lives much easier. Instead of altering file contents with editor, the user can simply go to the website admin
    MySQL, Memcache, PHP revised
    Employee +0 Vote Up -0Vote Down

    Some time ago I was writing about the InnoDB Memcache Daemon plugin already for the MySQL server. Back then we had a labs release with a little preview only. Meanwhile quite some time passed and new developments were made - just in time for the MySQL 5.6 RC announced this weekend by Tomas.

    The innodb_memcache daemon plugin is a plugin for the MySQL Server end contains an embedded memcached. This embedded memcached is configured to use MySQL's InnoDB engine as storage backend. By using this data stored inside an InnoDB table can be accessed using memcache's key-value protocol. Back in the times of the previous blog post this was limited to data from a

      [Read more...]
    Configuring Your LEMP System (Linux, nginx, MySQL, PHP-FPM) For Maximum Performance
    +0 Vote Up -0Vote Down

    Configuring Your LEMP System (Linux, nginx, MySQL, PHP-FPM) For Maximum Performance

    If you are using nginx as your webserver, you are looking for a performance boost and better speed. nginx is fast by default, but you can optimize its performance and the performance of all parts (like PHP and MySQL) that work together with nginx. Here is a small, incomprehensive list of tips and tricks to configure your LEMP system (Linux, nginx, MySQL, PHP-FPM) for maximum performance. These tricks work for me, but your mileage may vary. Do not implement them all at once, but one by one and check what effect the modification has on your system's performance.

    Top 10 MySQL Tips and Mistakes for PHP Developers (Webinar)
    +1 Vote Up -0Vote Down

    Tuesday, September 25, 2012

    MySQL and PHP are two key components in the open-source LAMP stack, and are widely used by web developers. One day you launched a website, and it gradually gained traction and now serves hundreds times more traffic than day one. As a PHP developer, have you ever looked back and adjusted the MySQL configurations accordingly to meet the most current website load? Have you ever wondered if there are secret tips you might have missed or common mistakes that you could have avoided but never thought of? If you answered yes to either question, this presentation is for you!

    In this live webinar, PHP & MySQL experts Ulf Wendel and Johannes Schlüter will share the top 10 tips and mistakes for PHP developers. After a quick overview of lesser known but cool client and server features and plugins, and a recap

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

    Installing Apache2 With PHP5 And MySQL Support On OpenSUSE 12.2 (LAMP)

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

    RainGauge, the new killer tool ?
    +0 Vote Up -0Vote Down

    I’m sure you’ve heard of Box Anemometer from the Box (MySQL) team, an excellent UI tool based on pt-query-digest. Now the guys from the box team offer us another killer UI tool based on pt-stalk, and I’m sure you will really appreciate to use it !

    What is it ?

    RainGauge” consists of three parts :

    • A set of scripts that collect data about the health of your system and your databases (based on pt-stalk)
    • A process that push these data on a centralised place
    • A very simple interface to navigate in the collected data
    But the collection begins only when specific conditions are triggered, and you choose what these conditions are. Find
      [Read more...]
    ConFoo 2013: Call for Papers is Now Open!
    +0 Vote Up -0Vote Down

    ConFoo is one of the most important web developer-oriented conferences. ConFoo 2013 will be held on February 25 through March 1 in Montreal, Canada.

    We just opened call for papers and we are looking for the best PHP, Java, Ruby, DotNet,HTML5 experts who are willing to share their knowledge with the Canadian community. Candidates can submit proposals until September 23. Consult the call for papers page for details and to start submitting. That page also explains what expenses ConFoo can cover for speakers. You can also get advice on how to write proposals.

    The call for papers is public, meaning that all proposals get published on the website for others to

      [Read more...]
    Y Gatorz are Considering Moving Back to a Gator Farm Instead of MapReducing the World
    +0 Vote Up -1Vote Down
    NSFW (audio) “…pipe your data to /dev/null – it will be very fast.” “Does /dev/null support sharding?” NSFW (audio) “…the only thing constructive we could have used their source files for was as random keys for SSL certs.” NSFW (audio) “PHP reeks … Continue reading →
    Installing Lighttpd With PHP5 (PHP-FPM) And MySQL Support On CentOS 6.3
    +0 Vote Up -0Vote Down

    Installing Lighttpd With PHP5 (PHP-FPM) And MySQL Support On CentOS 6.3

    Lighttpd is a secure, fast, standards-compliant web server designed for speed-critical environments. This tutorial shows how you can install Lighttpd on a Centos 6.3 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.

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

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

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

    PHP for MySQL Striped View
    +1 Vote Up -0Vote Down

    Back in May I explained how to create MySQL striped views with session variables. A couple folks wanted to know how to implement them through PHP programs. The trick is sharing the same connection between a call to the function before a query against the striped view.

    I’ve updated the MySQL example beyond the Hobbit analogy from the prior post. It now uses the following database components:

    • A striped AUTHORIZED_USER view
    • A FUNCTION_QUERY view to optimize function calls
    • A SET_LOGIN function
    • A GET_LOGIN_ID function
    • A GET_USER_ID function

    The definition of the APPLICATION_USER table is:

      [Read more...]
    Free Oracle PHP Book
    +1 Vote Up -0Vote Down

    Six years ago, I wrote Oracle Database 10g Express Edition PHP Web Programming for the release of the express edition. It was a lot of fun to write because I enjoy the PHP programming language, but unfortunately sales didn’t measure up too well. That’s probably because the population of PHP developers working with Oracle was small.

    Today it seems there are more PHP developers working with Oracle 11g. While the population of PHP community for Oracle 11g is still smaller than for MySQL, it continues to grow

      [Read more...]
    One-way Password Crypting Flaws
    +0 Vote Up -0Vote Down

    I was talking with a client and the topic of password crypting came up. From my background as a C coder, I have a few criteria to regard a mechanism to be safe. In this case we’ll just discuss things from the perspective of secure storage, and validation in an application.

  • use a digital fingerprint algorithm, not a hash or CRC. A hash is by nature lossy (generates evenly distributed duplicates) and a CRC is intended to identify bit errors in transmitted data, not compare potentially different data.
  • Store/use all of the fingerprint, not just part (otherwise it’s lossy again).
  • SHA1 and its siblings are not ideal for this purpose, but ok. MD5 and that family of “message digests” has been proven flawed long ago, they can be “freaked” to create a
  •   [Read more...]
    PHP/MySQL Query
    +1 Vote Up -0Vote Down

    Somebody wanted an example of how to handle column values using PHP to query a MySQL database. While I thought there were enough examples out there, they couldn’t find one that was code complete.

    Well, here’s one that works using a static query. If you want to use a prepared statement, check this earlier post.

    <title>Static Query Object Sample</title>
    <style type="text/css">
      /* HTML element styles. */
      table {background:white;border-style:solid;border-width:3px;border-color:black;border-collapse:collapse;}
      th {text-align:center;font-style:bold;background:lightgray;border:solid 1px gray;}
      td {border:solid 1px gray;}
      /* Class tag element styles. */
      .ID {min-width:50px;text-align:right;}
      [Read more...]
    Statistical functions in MySQL
    +3 Vote Up -0Vote Down

    Even in times of a growing market of specialized NoSQL databases, the relevance of traditional RDBMS doesn't decline. Especially when it comes to the calculation of aggregates based on complex data sets that can not be processed as a batch like Map&Reduce. MySQL is already bringing in a handful of aggregate functions that can be useful for a statistical analysis. The best known of this type are certainly:

    Read the rest »

    Lock Wait Timeout Errors or Leave Your Data on the Server
    +0 Vote Up -0Vote Down
    If you use MySQL with InnoDB (most everyone) then you will likely see this error at some point. There is some confusion sometimes about what this means. Let me try and explain it.

    Let's say we have a connection called A to the database. Connection A tries to update a row. But, it receives a lock wait timeout error. That does not mean that connection A did anything wrong. It means that another connection, call it B, is also updating a row that connection A wants to update. But, connection B has an open transaction that has not been committed yet. So, MySQL won't let you update that row from connection A. Make sense?

    The first mistake people may make is looking at the code that throws the error to find a solution. It is hardly ever the code that throws the error that is the problem. In our case, it was code that was doing a simple insert into a table. I had a look at our processing logs

      [Read more...]
    Stop comparing stuff you don't understand
    +2 Vote Up -1Vote Down
    I normally don't do this. When I see someone write a blog post I don't agree with, I often just dismiss it and go on. But, this particular one caught my attention. It was titled PHP vs Node.js: Yet Another Versus. The summary was:

    Node.js = PHP + Apache + Memcached + Gearman - overhead

    What the f**k? Are you kidding me? Clearly this person has NEVER used memcached or Gearman in a production environment that had any actual load.

    Back in the day, when URLs and filesystems had a 1:1 mapping, it made perfect sense to have a web server separate from the language it is running. But, nowadays, any PHP app with attractive URLs running behind the Apache web server is going to need a .htaccess file, which tells the server a regular expression to check before serving up a file.

      [Read more...]
    Previous 30 Newer Entries Showing entries 61 to 90 of 850 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.