Last week I posted how to configure and test Ruby and MySQL. Somebody asked me how to handle a dynamic list of columns. So, here’s a quick little program to show how to read the list of column:
It turns out that configuring Perl wasn’t the last step for my student instance. It appears that I neglected to configure my student instance to support Java connectivity to MySQL. This post reviews the configuration of Java to run programs against MySQL. It also covers the new syntax on how you register a
DriverManager, and avoid Java compilation errors with the older syntax.
In prior posts, I’ve shown how to use Perl , PHP (more...)
Two recent blogs from engineering managers at successful Web properties have highlighted the wisdom of selecting proven and mature technologies, whether for new startups or projects.
The first one is entitled "Learn to stop using shiny new things and love MySQL", by Marty Weiner, Engineering Manager at Pinterest. Marty starts off explaining "A good portion of the startups I meet and advise want to use the newest, hottest technology to build something (more...)
Sometimes trying to keep a post short and to the point raises other questions. Clearly, my Python-MySQL Program post over the weekend did raise a question. They were extending the query example and encountered this error:
TypeError: range() integer end argument expected, got tuple.
That should be a straight forward error message because of two things. First, the Python built-in
range() function manages a range of numbers. Second, the row returned (more...)
Configuring Perl to work with MySQL is the last part creating a complete Fedora Linux LAMP stack for my students. Perl is already installed on Fedora Linux.
I’ve also shown how to use PHP, Python, and Ruby languages to query a MySQL database on Linux. After installing this additional Perl DBI library, my students will have the opportunity to choose how they implement their LAMP solution.
You can find the Perl version with (more...)
The Fedora Linux distribution installs Python 2.7 by default. Unfortunately, the
MySQL-python library isn’t installed by default. You can verify the Python version by writing and running the following
version.py program before installing the
# Import sys library.
# Print the Python version.
You can run the
version.py program dynamically like this:
It will print the (more...)
Most folks know how important JSON is to web development but (more...)
After you install Ruby and build the Rails framework, you need to create the
mysql gem. This blog post shows you how to create the
mysql gem and how to write a simple Ruby program that queries the MySQL database.
The first step creates the
mysql gem for Ruby programming:
It should show you the following:
Fetching: mysql-2.9.1.gem (100%)
Building native extensions. This could take (more...)
I use a Fedora 20 VM image to teach Oracle and MySQL technology. Last week, I expanded the Fedora VM image to support a full LAMP stack. This blog shows you how to install Ruby on Fedora and successfully generate the Rails gems.
Connect as the
root user and use yum to install the libraries. My approach is by library or small groups. Naturally, you start with the
You will (more...)
This is a quick post on issues I faced while restoring a slave when GTID was enabled on master.
I have master created few days back and now I am trying to create a slave. I have GTID enabled on master.
root [mysql] >show master status G
*************************** 1. row ***************************
1 row in set (0.00 sec)
root [mysql] >show (more...)
This is a small article telling how to move a innoDB table from one MySQL server to another.
Moving MyISAM table from one server to another is very straight forward process. MyISAM table generates 3 files at file system level.
- .frm file contains table structure/definition
- .MYD file contains table data
- .MYI file contains index data
We can simply copy these 3 files to another MySQL server installation under desired database and it will show up (more...)
Percona Toolkit is collection of command-line tools to perform many MySQL tasks like creating backups, finding duplicate indexes, managing replication, etc.
In this post I will talk about how to measure replication lag and check/fix replication inconsistencies with this tools: pt-heartbeatpt-table-checksumpt-table-sync
I am using environment from previous blog post.
Master-Master replication with MariaDB 10.0.16 database on Debian 7.
Install Percona Toolkit
on both nodes:
$ sudo wget percona.com/get/percona-toolkit.deb
There could be situations where we have to disable GTID in our replication setup.
We can follow below steps to do so. No need to change any GTID related parameters. We just have to change slave configuration and bounce slave. No need to touch master.
Step 1) Confirm that you are using GTID
If you check processlist on master, you can see GTID is enabled
master> show processlist G
*************************** 1. row ***************************
If we talk about MySQL replication, we always default to asynchronous replication. By asynchronous, we mean master will keep doing transactions while they are getting replicated to slave via IO thread asynchronously. In this replication, its possible that slave will fall behind but that does not impact master in anyway.
Problem with this replication is data-loss. Example: In case slave is falling behind and master host crashes, some of the transactions may not get transfered/replicated (more...)
The simplest and probably most common replication method is master-slave
replication. Basically, data is replicated from master database to the slave. In case of master database failure you must get the slave database up-to-date before failover and then promote slave to be new master.
Another method is to set up replication in both directions called master-master
replication. But you must be aware that this setup brings some potential issues as data changes are happening on (more...)
I'm looking at the most popular content on my blog from time to time and try to address your needs the best. So, reading my blog is the one way for my fellow readers to drive the content. Another way is to reach out to me in comments or via email. For today, I am going to revamp my JDBC Realm
example with Primefaces and update it to latest WildFly server.Preparations
First step is (more...)
Performance schema, as name suggest is a tool for monitoring MySQL performance. It was implemented staring from MySQL 5.5 and improved further in MySQL 5.6. Performance Schema includes set of tables that gives information on how database is performing. It provides a way to inspect internal execution of the server at run time. Performance schema monitors every “event” the server does that takes time and has been instrumented so that timing information can (more...)
I’m taking a few weeks defocused from work, as a kind of grandpaternity leave. That said, the venue for my Dances of Infant Calming is a small-but-nice apartment in San Francisco, so a certain amount of thinking about tech industries is inevitable. I even found time last Tuesday to meet or speak with my clients at WibiData, MemSQL, Cloudera, Citus Data, and MongoDB. And thus:
1. I’ve been sloppy in my terminology around “geo-distribution”, in (more...)