Let’s say you’re using Docker for your local development in order to keep your development system nice and clean. Not having to install all needed dependencies on your local machine (like for instance PostgreSQL) and have everything packaged and documented for all developers is one of the advantages containers bring us. But when developing in Rails, … Continue reading How to install ruby pg gem without PostgreSQL locally
Tag: databases
Taking mysql dumps is pretty straightforward, but what if you needed to take a dump excluding certain tables? For this, you have two options: 1. use the –ignore-table option: mysqldump -u username -p database –ignore-table=database.table1 –ignore-table=database.table2 > database.sql This works fine as long as you don’t have too much tables to exclude. 2. The second … Continue reading Taking MySQL dumps with a twist
A lot of times, developers are asked to export data from a MySQL database to hand over to a client. In most of the cases, when tools like phpMyAdmin are available, the data is exported through the web tool. But when no such tools are at hand, developers most likely turn to their developers skills … Continue reading Export directly from MySQL to CSV
MySQL and replication, it has always been a touchy subject. Overall, things work properly. Non the less, on a certain project, we experienced regular replication failures: Error ‘Can’t create table ‘db.temp_table’ (errno: -1)’ on query. Default database: ‘db’. Query: ‘CREATE TEMPORARY TABLE temp_table … Basically the errors clearly points out that the temporary MySQL table … Continue reading Mysql temporary tables and replication
A few days ago, I tried to make a backup using the mysqldump command and got the following error: mysqldump: Got error: 1044: Access denied for user ‘root’@’localhost’ to database ‘information_schema’ when using LOCK TABLES A quick workaround is to pass the –-single-transaction option to mysqldump: $ mysqldump –single-transaction -u user -p DBNAME > backup.sql … Continue reading mysqldump: 1044 Access denied when using LOCK TABLES
Like a lot of developers, I’ve been watching the movement of MySQL since it has been acquired by Oracle. Since the acquisition, a lot of MySQL forks have been created. Think of MariaDB and Drizzle. I’ve also been looking at PostgreSQL. Since long, I’ve wanted to start personal project using PostgreSQL. So I decided to migrate … Continue reading Migrate from MySQL to PostgreSQL
Just got my new MacPro this weekend. After installing my common applications, I had to install my development tools as well. These are the instructions to install MySQL 64-bit version on OS X Snow Leopard. First of all, note that we are going to install MySQL compiling from source. So make sure you have installed … Continue reading Installing MySQL on Snow Leopard
Finally, I found a nice solution for the RoR 2.2 MySQL problem. The initial problem was that the MySQL library isn’t bundled with RoR anymore, and you need to install it as a gem. No big deal at first, but we Leopard users are “plagued” with the fact that Apple has somewhat of an exotic … Continue reading Mac Leopard, ROR 2.2 and MySQL
There is one plugin that I use in all my projects, and that is the Foreign Key Migrations plugin from RedHill. Defining foreign keys can’t become easier then this. Since as far as I know, Rails migrations don’t set foreign keys in your database, so this is the best solution. It uses SQL-92 syntax and as … Continue reading Rails and foreign keys
As I said in my previous post, I would tell more about why I switched to Doctrine. I mainly started to think about the idea when I first heard that we were going to start a new project in Symfony at work. The lead developer decided to go for Doctrine ORM instead of Propel. So … Continue reading Why I switched to Doctrine