mysql

MySQL copy/duplicate database

What is the best way to duplicate a mysql db into another without using mysqldump? With content and without content. I am currently using mysql 4.0 UPDATE: Witout local access to the server. ...

Using MySQLi - which is better for closing queries

I have a habit of keeping my variable usage to a bare minimum. So I'm wondering if there is any advantage to be gained by the following: $query = $mysqli->query('SELECT * FROM `people` ORDER BY `name` ASC LIMIT 0,30'); // Example 1 $query = $query->fetch_assoc(); // Example 2 $query_r = $query->fetch_assoc(); $query->free(); Now if...

New Project : MySQL or SQL 2005 Express.

I am starting a new client/server project in work and I want to start using some of the newer technologies i've been reading about, LINQ and Generics being the main ones. Up until now I have been developing these types of applications with MySQL as clients were unwilling to pay the large licence costs for MSSQL. I have played around ...

MySQL vs PostgreSQL for Web Applications

I am working on a web application using Python (Django) and would like to know whether MySQL or PostgreSQL would be better when deploying for production. In one podcast Joel said that he had some problems with MySQL and the data wasn't consistent. I would like to know whether someone had any such problems. Also when it comes to perfo...

Is there a rake task for backing up the data in your database?

Is there a rake task for backing up the data in your database? I already have my schema backed up, but I want to make a backup of the data. It's a small MySQL database. ...

Does MS-SQL support in-memory tables?

I've grown up as a programmer using MySQL all the way. Recently, I started changing some of our applications to support MS SQL Server as an alternative backend. One of the compatibility issues I ran into is the use of MySQL's CREATE TEMPORARY TABLE to create in-memory tables that hold data for very fast access during a session with no ne...

SQL Group By with an Order By

I have a table of tags and want to get the highest count tags from the list. Sample data looks like this id (1) tag ('night') id (2) tag ('awesome') id (3) tag ('night') using SELECT COUNT(*), `Tag` from `images-tags` GROUP BY `Tag` gets me back the data I'm looking for perfectly. However, I would like to organize it, so that the ...

Mysql: Using "AND" Operation on tags and categories tables in Wordpress

This is a very specific question regarding mysql as implemented in WordPress. I'm trying to develop a plugin which will show (select) posts that have specific 'tags' and belong to specific 'categories' (both multiple) I was told it's impossible because the way categories and tags are stored: wp_posts contains a lists of post, each po...

What are good resources for taking the step up from entry level MySQL?

I've sort of slipped into the area of web development by chance, and because of this I lack training in the handling of databases (mostly MySQL in my case). I've come to know the basic stuff (SELECT, WHERE and even JOIN) but I'm often frustrated when I need to do more advanced queries. The problem for me is not finding resources descri...

How to work around unsupported unsigned integer field types in MS SQL?

Trying to make a MySQL-based application support MS SQL, I ran into the following issue: I keep MySQL's auto_increment as unsigned integer fields (of various sizes) in order to make use of the full range, as I know there will never be negative values. MS SQL does not support the unsigned attribute on all integer types, so I have to choo...

MySQL Binary Log Replication: Can it be set to ignore errors?

I'm running a master-slave MySQL binary log replication system (phew!) that, for some data, is not in sync (meaning, the master holds more data than the slave). But the slave stops very frequently on the slightest MySQL error, can this be disabled? (perhaps a my.cnf setting for the replicating slave ignore-replicating-errors or some of t...

MySQL Results to a File

How do I write the results from a mysql query to file? I just need something quick. Output can be CSV, XML, HTML, etc. ...

Does Visual Studio Server Explorer support custom database providers?

I had used Server Explorer and related tools for graphical database development with Microsoft SQL Server in some of my learning projects - and it was a great experience. However, in my work I deal with Oracle DB and SQLite and my hobby projects use MySQL (because they are hosted on Linux). Is there a way to leverage the database-relate...

Wordpress MediaWiki Integration

On the other end of the spectrum I would be happy if I could install a Wiki and share the login credentials between WordPress and the Wiki. I hacked MediaWiki a while ago to share logins with another site (in Classic ASP) via session cookies and it was a pain to do and even worse to maintain. Ideally I would like to find a plug-in or s...

Does limiting a query to one record improve performance

Will limiting a query to one result record, improve performance in a large(ish) MySQL table if the table only has one matching result? for example select * from people where name = "Re0sless" limit 1 if there is only one record with that name? and what about if name was the primary key/ set to unique? and is it worth updating the qu...

MySQL "Error 1005" when adding tables

I've recently been working with a MySQL Database, and using MySQL workbench to design the Database. When I use the export to SQL function - so I can actually get the layout in to the Database - I get "Error 1005: Cannot create table" from MySQL. This appears to be related to Foreign Keys in the create table statement. Does anybody hav...

Migrating database changes from development to live

Perhaps the biggest risk in pushing new functionality to live lies with the database modifications required by the new code. In Rails, I believe they have 'migrations', in which you can programmatically make changes to your development host, and then make the same changes live along with the code that uses the revised schema. And roll bo...

Would building an application using a Sql Server Database File (mdf) be a terrible idea?

I'm working on a side project that would be a simple web application to maintain a list of classes and their upcoming schedules. I would really like to use Linq to SQL for this project, but unfortunately the server environment I'm developing for only has MySql available. I've dabbled briefly with Subsonic but it just doesn't get the job...

mysql software: any suggestions to oversee my mysql replication server?

I've had a tough time setting up my replication server. Is there any program (OS X, Win, Linux or php no problem) that lets me monitor and resolve replication issues? (btw, for those -uhm- following, ive been on this issue here, here, here and here. Either i'm going about this the wrong way or i must be immensely thick) My production da...

MySQL shell on Windows

The command line interface to MySQL works perfectly well in itself, but when using my local copy I'm forced to interact with it using the old-fashioned DOS windows. Is there some way I can redirect it through a better shell? ...