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 中文
Showing entries 1 to 18

Displaying posts with tag: hacking (reset)

Better MySQL Security and Administration
+0 Vote Up -0Vote Down

Download PDF Presentation

With the recent cyber attacks and breaches with data from large organizations including Sony, is your MySQL data safe? What are the best practices for securing and administering your MySQL environment? In this presentation we will cover the essential steps for better MySQL security. We will also cover the different installation and administration tasks necessary to ensure your data is managed.

Presenter: Ronald Bradford
Schedule: Insight Out DB Showcase. October 2011 Tokyo, Japan

Multi-tenancy Drizzle
+5 Vote Up -0Vote Down

My previous post focused on some of the problems of doing multi-tenant MySQL.

One of the reasons why I started hacking on Drizzle was that the multi-tenancy options for MySQL just weren’t very good (this is also the reason why I run my blog in a VM and not a shared hosting solution).

What you really want is to be able to give your users access to a virtual database server. What you don’t want is to be administering a separate database server for each of your users. What you want are CATALOGs.

A CATALOG is a collection of SCHEMAs (which have TABLEs in them). Each CATALOG is isolated from all the others. Once you connect to a catalog, that’s it. They are entirely separate units. There are no cross-catalog queries or CHANGE CATALOG commands. It is as

  [Read more...]
BlitzDB Crash Safety and Auto Recovery
+0 Vote Up -0Vote Down

Crash Safety is a big deal in the database league. Lack of durability can lead to all sorts of terrible things upon a catastrophic event. Many projects, especially in the so called NoSQL world compromises crash safety in return for higher QPS. The argument there is that the availability of the overall system should be accomplished by replication since a database server can’t be rescued if the physical disk breaks. I happen to agree with this philosophy but I am also aware that this isn’t a correct answer for everyone. So, what will I do with BlitzDB?

Several relational database hackers have pointed out that BlitzDB isn’t any safer than MyISAM since it doesn’t guarantee crash safety. This is currently true but I plan on making BlitzDB much safer than MyISAM by providing following features.

  • Auto Recovery Routine (startup option)
  • Tokyo
  •   [Read more...]
    MySQL client tool and how to output newlines
    Employee_Team +2 Vote Up -0Vote Down

    This blog posts explains how to add a new line in strings in MySQL Stored Procedures and how to output the result using the MySQL client tool.

    Today I was fooling around with some stored procedure making it more fancy and stuff. What I wanted was the OUT variable to contain a newline. Easy of course, using CONCAT:

    mysql> SELECT CONCAT('foo','\n','bar');
    +--------------------------+
    | CONCAT('foo','\n','bar') |
    +--------------------------+
    | foo
    bar                  |
    +--------------------------+

    Now, if youconcat strings in a stored

      [Read more...]
    Simulating server-side cursors with MySQL Connector/Python
    Employee_Team +1 Vote Up -1Vote Down

    Last week, my colleague Massimo and I discussed how to handle big result sets coming from MySQL in Python. The problem is that MySQL doesn't support server-side cursors, so you need to select everything and then read it. You can do it either buffered or not. MySQL Connector/Python defaults to non-buffered, meaning that you need to fetch all rows after issuing a SELECT statement. You can also turn on the buffering, mimicking what MySQL for Python (MySQLdb) does.

    For big result sets, it's better to limit your search. You can do this using an integer primary key or some temporal field for example. Or you can use the LIMIT keyword. The latter solution is what

      [Read more...]
    Freiwild almost ready for Django 1.0.2
    Employee +0 Vote Up -0Vote Down
    I've been working on our Freiwild Shop website today making it compatible with Django 1.0.2 (final(ly)!). Basically, what I've done is try to run it and fix where it errors following the direction documented in the manual. I think that the next days I'll see how I can optimize the MySQL usage a bit.

    The shop I've build has little models and doesn't use to much fancy tricks. Among the changes:
    • Templates: extends should be on the first line

    • Models: should not contain anything Admin-related. This is actually very nice, seperating models.py and admin.py.

    • Model Fields: maxlength changed to max_length, oldforms/newforms options disappeared, small stuff like





      [Read more...]
    SugarCRM not committing transactions? (installation)
    Employee +0 Vote Up -0Vote Down
    What does a MySQL Support Engineer do during his first hours of vacation? Yes, napping. After that, he goes on the web and tries out something new. Today: SugarCRM .. and struggeling a little with the installation.

    The problem? The installation (on MacOS 10.5) was successful, no errors, but:
    Sugar CRM 5.1.0c Files May Only Be Used With A Sugar CRM 5.1.0 Database

    Logging didn't reveal anything, but the general query log did! All DML statements were send to MySQL, but apparently not .. committed? After looking in the code I noticed a lack of commit statements.. Putting an explicit commit it worked, for the `config` table.

    What was the real problem?

    [mysqld]
    init_connect='SET AUTOCOMMIT=0'

    Don't ask me why that was there, sometimes I do crazy











      [Read more...]
    Changing Lanes: Leaving Sun/MySQL
    +0 Vote Up -0Vote Down
    After having worked for two years and one quarter of a year with MySQL AB (now Sun), I have decided to resign and pursue another career.

    Before I joined MySQL AB I was working as a database consultant and application developer. I knew that joining MySQL would mean giving that up, but I was happy to do so because I really liked the MySQL product. I was also attracted by the company itself, the flexible working hours, working from home, travelling abroad, and, very important, being one of the few companies that is capable creating FOSS software on a commercial basis.

    I have had a splendid time at MySQL AB, and later Sun. I met lots of smart people and travelled to a bunch of places I would probably not've had the chance



      [Read more...]
    Building MySQL from Source: There's a fine line...
    +0 Vote Up -0Vote Down

    There's a fine line between love and hate, you see

    Can't wait to late, but baby I'm on it


    (From: "Liberation" by Outkast)

    Suppose you need to build a MySQL server with the same options as a pre-built one, distributed through the MySQL download site.

    Sounds strange?

    Well, maybe, but that's what you need if you want to compile certain MySQL 5.1 plug-ins so that they'll will play nice with such a pre-built server.

    Some plug-ins depend on nothing more but the plugin.h header file, but for example storage engine plug-ins require things way beyond that. If you want to











      [Read more...]
    My Sakila Cube
    Employee +0 Vote Up -0Vote Down

    My Sakila Cube (black)
    Originally uploaded by Geert JM VanderkelenThis is maybe an old idea, but still great to do! Thanks to Ronald's tip I could make the cube you see here. Just pure fun!

    Check out how to do on Ned Batchelder's site!

    (Also thanks to Ronald Bradford, I can walk the earth with my good walking shoes! )
    Recycling old MySQL business cards
    Employee +0 Vote Up -0Vote Down

    Recycling old MySQL business cards
    Originally uploaded by Geert JM VanderkelenWell, we don't have a policy on what to do with them, so I went creative. Not as creative as Harrison did (where is that picture???), but I like it. It's hanging next to my MySQL certificates. Yes, I'm proud on these things, maybe I'm a bit vain.. But it does look good on the wall of my storage room.

    (btw, this flickr to Google blogging is great!)
    UDFs at the MySQL User's conference
    +0 Vote Up -0Vote Down
    The MySQL User's conference will be held in less than a month from now!!!

    This year there is quite a good number of sessions on adding your own functions and procedures, such as:



      [Read more...]
    MySQL Stored Procedures: CASE syntax
    +0 Vote Up -0Vote Down
    Thank you all for taking the time to respond to the little challenge I posted yesterday! I am pleasantly surprised to note that so many people took the time to post a solution. And most people provided the correct answer too: you are all entitled to a well deserved discount to register for the MySQL User's conference!!!

    For those of you interested in the solution: there are two different forms of the CASE statement syntax: the so-called simple case and the searched case.

    The simple case selects one WHEN...THEN branch by comparing the value



      [Read more...]
    MySQL stored procedurs: ...the CASE that they gave me...
    +0 Vote Up -0Vote Down
    Let's see if you can solve this little puzzle...

    Consider this stored procedure:

    -- finds the first slash and exits
    create procedure p_find_slash(p_text text)
    begin
    declare v_index int default 1;
    declare v_length int default character_length(p_text);
    declare v_char char(1);

    _main_loop: while v_index -- loop over all characters

    set v_char := substring(p_text, v_index, 1); -- grab the current character
    case v_char
    when v_char = '/' then -- found a slash!
    select concat('A slash at ', v_index) message; -- report it
    leave _main_loop; -- and then stop


















      [Read more...]
    Reporting MySQL Internals with Information Schema plug-ins
    +0 Vote Up -0Vote Down
    Last week, I described how to use the MySQL plug-in API to write a minimal 'Hello world!' information schema plug-in. The main purpose of that plug-in is to illustrate the bare essentials of the MySQL information schema plug-in interface.

    In this article, I'd like to take that to the next level and demonstrate how to write an information schema plug-in that can access some of the internals of the MySQL server. For this particular purpose, we will focus on a plug-in that reports all the SAVEPOINTs

      [Read more...]
    Postfix, MySQL, DoveCot, Spamassassin, Sieve: YES!
    Employee +0 Vote Up -0Vote Down
    This is more venting my frustration over installing Postfix on a new (xen)box (old 1U VALinux finally crashed, blablah..).

    I have been putting days, if not weeks into trying to figure out how to make Postfix with virtual users work together with Amavis and Spamassassin so it filters out to the Spam maildir of users.
    Now, some will say: oh, that's peanuts. You take Courier's Maildrop and off you go.. Maybe I'm stupid with this, maybe, but it took me far less headaches and an hour (+ burger + pint in the bar) to get Dovecot 'deliver' figured out with Sieve.. and it actually works!

    What I have now working on my Ubuntu Feisty server is:
    * Postfix with virtual users using MySQL 5.1 (duh)
    * Amavisd going through new email using Spamassassin (still have to figure out how to add the X-Spam header)
    * Using Dovecot's deliver tool







      [Read more...]
    Django Goodies
    Employee +0 Vote Up -0Vote Down
    I'm starting to get into Django more and more, forgetting PHP. And some nice stuff is coming up.

    Yesterday there was a post about a Django Cheat Sheet published by folks at Mercurytide. Still work in progress, but all tools are welcome for a 'starting' project.

    And then there is the Django Book. It's getting quite heavy already in pages and you can leave comments to make it even better!
    Of course, there are the usual PostgreSQL posts.. Well, they are funny. Like the one on Chapter 2 suggesting to indeed sort the database engines alphabetically because they should be equally good, but keep PostgreSQL first in the list.

    Other comments suggest the MySQL python module MySQLdb doesn't work with Python






      [Read more...]
    In the house we have, pread() and pwrite() performance
    +0 Vote Up -0Vote Down
    Let us talk about pread() and pwrite() for a moment.

    So what are the differences between the two of these, and read() and write()?

    The difference between pread() and read() is that pread() is an atomic action.

    Let me explain why.

    For the average application that is reading data you would normally be doing a seek and then do your call to read(). If you are reading sequentially in a file you will never do the seek call, all you will do is the read() call. The read call causes an update to the the file descriptors position.

    Now lets look at the problem where you are reading different blocks of the file instead of reading all blocks sequentially. Calling read () means that you will be doing your call to seek and then updating file->f_pos for the operation. For a pread() the operation of seek is internalized and file->f_pos will not be updated.









      [Read more...]
    Showing entries 1 to 18

    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.