mysql

MySQL tools which ease creation of SQL JOIN statements?

Does anyone know tools which look at a MySQL database, show you all the tables graphically and allow you to create complicated JOIN statements via drag-and-drop? ...

Trip time calculation in relational databases?

I had this question in mind and since I just discovered this site I decided to post it here. Let's say I have a table with a timestamp and a state for a given "object" (generic meaning, not OOP object); is there an optimal way to calculate the time between a state and the next occurrence of another (or same) state (what I call a "trip")...

PHP/mySQL - regular recalcuation of benchmark values as new users submit their data

I am confronted with a new kind of problem which I haven't encountered yet in my very young programming "career" and would like to know your opinion about how to tackle it best. The situation A research application (php/mysql) gathers stress related health data from users. User gets a an analyses after filling in the questionnaire. Valu...

mysqldump | mysql yields 'too many open files' error. Why?

I have a RHEL 5 system with a fresh new hard drive I just dedicated to the MySQL server. To get things started, I used "mysqldump --host otherhost -A | mysql", even though I noticed the manpage never explicitly recommends trying this (mysqldump into a file is a no-go. We're talking 500G of database). This process fails at random inter...

Stored procedures a no-go in the php/mysql world?

I'm quoting part of an answer which I received for another question of mine: In the PHP/MySQL world I would say stored procedures are no-go I would like to know: Is that so? Why? Why not? [edit]I mean this as a general question without a specific need in mind[/edit] ...

C++ Class design from database schema

I am writing a perl script to parse a mysql database schema and create C++ classes when necessary. My question is a pretty easy one, but us something I haven't really done before and don't know common practice. Any object of any of classes created will need to have "get" methods to popluate this information. So my questions are twofol...

MySql - Create Table If Not Exists Else Truncate?

Here is the updated question: the current query is doing something like: $sql1 = "TRUNCATE TABLE fubar"; $sql2 = "CREATE TEMPORARY TABLE IF NOT EXISTS fubar SELECT id, name FROM barfu"; The first time the method containing this is run, it generates an error message on the truncate since the table doesn't exist yet. Is my only optio...

create an index on a mysql column based on the length its contents?

How do I create an index on a column in mysql v 5.0 (myisam db engine) based upon the length of its value its a TEXT data type up to 7000 characters, do I have to add another column with the length of the first column. Any help kindly received, cheers ...

SqlServer create table with MySql like auto_increment primary key

I want to make a table in SqlServer that will add, on insert, a auto incremented primary key. This should be an autoincremented id similar to MySql auto_increment functionality. (Below) create table foo ( user_id int not null auto_increment, name varchar(50) ) Is there a way of doing this with out creating an insert trigger? ...

Migrating from MySQL to arbitrary standards-compliant SQL2003 server

Is there an incantation of mysqldump or a similar tool that will produce a piece of SQL2003 code to create and fill the same databases in an arbitrary SQL2003 compliant RDBMS? (The one I'm trying right now is MonetDB) ...

textboxes in Datarepeater dynamicly 'databound'

I need to know if it is possible to dynamically bind a textbox residing within a datarepeater to a 'dynamically' created BindingSource. I am using VB.net. The database I am using is a MySQL database. I have to use the connection dynamicly due to the fact that the database my not permanently reside on the same server. [edit] ok, so ...

How do I restore from a drop database command using a mysql binary log?

How can I restore a mysql database that was dropped using a "drop database" command? I have access to binary logs which should make this type of rollback possible. ...

How do you connect to a MySQL database using Oracle SQL Developer?

I have Oracle SQL Developer already installed and am able to connect to and query Oracle databases. Using Help -> Check for Updates I was able to install the Oracle MySQL Browser extension but there are no connection options for MySQL databases. ...

Enforce unique rows in MySQL

I have a table in MySQL that has 3 fields and I want to enforce uniqueness among two of the fields. Here is the table DDL: CREATE TABLE `CLIENT_NAMES` ( `ID` int(11) NOT NULL auto_increment, `CLIENT_NAME` varchar(500) NOT NULL, `OWNER_ID` int(11) NOT NULL, PRIMARY KEY (`ID`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8; The ID field is a s...

A visual MySQL tool for Ubuntu

Hi all I have recently installed Ruby on Rails on my new Ubuntu machine (first time for me) and i was working through a demonstration on setting up a sample blog. Basically, i came to the part of setting up the mysql database and would rather use a visual MySQL tool to do this rather than command line. What is best to use? and how do ...

Mysql stored procedure

How to create optional parameter in mysql stored procedure? ...

How to change default order of Group By clause in mysql

By default data extracted by group by clause is ordered as ascending. How to change it to descending. ...

What database privileges does a Wordpress Blog really need?

I am setting up a few Wordpress blog sites. I have created a user in mysql that wordpress will use to access its database. The docs say to give this user all privileges on the database. Does it really need full privileges? I expect not, so does anyone know the min set of privileges that it really needs? ...

How do I completely disable MySQL replication

I am running dual master MySQL replication and now want to move to a single database with no replication. How do I completely disable replication on both databases? ...

Is there a simple tool to convert mysql to postgresql syntax?

I've tried the tools listed here, some with more success than others, but none gave me valid postgres syntax I could use (tinyint errors etc.) ...