mysql

Migrate Data and Schema from MySQL to SQL Server

Are there any free solutions for automatically migrating a database from MySQL to SQL Server Server that "just works"? I've been attempting this simple (at least I thought so) task all day now. I've tried: SQL Server Management Studio's Import Data feature Create an empty database Tasks -> Import Data... .NET Framework Data Provider ...

Does it make sense to use BOTH mongodb and mysql in the same rails application?

I have a good reason to use mongodb for part of my app. But people generally describe it as not a good fit for "transactional" applications like a bank where transactions have to be exact/consistent, etc. Does it make sense to split the models up in Rails and have some of them use MySql and others mongo? Or will this generally cause...

Trying to get unique records with MySQL

I have a query that is looking at a 'page_views' table. And I so far have the ability to get the total views by day. However, I am having an issue with getting unique views by day. The column I am testing against is user_id... Here's the query I have for total views. SELECT site_id, CONCAT( month(created_at) , '-' ...

passing a scalar query result to coalesce

How can I pass the result from a scalar [single row, single value] query to coalesce? I am trying to pick the priority as (the biggest priority so far in the table) + 1. [0 if it is the first row.] create trigger priority_SuperRuleSamples before insert on SuperRuleSamples FOR EACH ROW SET NEW.Priority=coalesce(NEW.Priority, coal...

fixed nr of decimals for float/double datatypes in mysql?

i've got one column named 'number' in mysql. it got datatype of float. currently it removes all trailing zeros. so 45.5400 would become 45.54. i wonder how i can correct this so the trailing zeros are preserved? ...

How mysql handles partitions internally

I would like to know how does mysql handles / implements the partitions internally. ...

Need some help with a MySQL subquery count

I'm running into my own limits of MySQL query skills, so I hope some SQL guru can help out on this one. The situation is as follow: I have images that can be tagged. As you might expect this is stored in three tables: Image Tag Tag_map (maps images to tags) I have a SQL query that calculates the related tags based on a tag id. The q...

field calculation trigger concurrency issue

Does this trigger have concurrency issues? Will I always get unique priorities? Is the trigger run sequentially per row? create trigger priority_SuperRuleSamples before insert on SuperRuleSamples FOR EACH ROW SET NEW.Priority=coalesce(NEW.Priority, coalesce( (select Priority from SuperRuleSamples order by Priority desc limit 1), ...

Mysql ERROR 1005 (HY000): Can't create table 'tmp' (errno: 13)

Hi, I'm Running Mysql on ubuntu 9.10, the process of Mysql is running as root, I'm using root account when logging to Mysql, which I gave all privileges, I'm using my own db(not mysql), I can create a table, but when i try to create Temporary table i get this error: ERROR 1005 (HY000): Can't create table 'tmp' (errno: 13) For this qu...

Example of moving from MySQL to NoSQL?

Hello, For a Facebook-like site, ie. which is write-intensive and delivers user-customized pages, I'd like to build a prototype to investigate whether the document-centric NoSQL architecture would be a good alternative to sharding and reduce the load on the single master (+ multiple slaves) that we currently use and is the bottleneck. ...

How does mysql define DISTINCT() in reference documentation

EDIT: This question is about finding definitive reference to MySQL syntax on SELECT modifying keywords and functions. /EDIT AFAIK SQL defines two uses of DISTINCT keywords - SELECT DISTINCT field... and SELECT COUNT(DISTINCT field) ... However in one of web applications that I administer I've noticed performance issues on queries like ...

Mysql partitioning: Partitions outside of date range is included

Hi, I have just tried to configure partitions based on date, but it seems that mysql still includes a partition with no relevant data. It will use the relevant partition but also include the oldest for some reason. Am I doing it wrong? The version is 5.1.44 (MyISAM) I first added a few partitions based on "day", which is of type "date...

Phpmyadmin foreign key drop-down field help

Hey guys i'm using phpmyadmin (php & mysql) and i'm having alot of trouble linking the tables using foreign keys. I'm getting negative values for the field countyId (which is the foriegn key). However it is linking to my other table fine and it's cascading fine. So when I go to add data there will be a drop box for the CountyId and the...

Advantages of using myisamchk over mysqlcheck?

I have been using MySQL for a number of years, and have got used to the occasional crash (some due to dodgy hardware, other due to dodgy code). When checinking/repairing tables, I have always used mysqlcheck after the server has started up again. Recently I had the luxury of not having to get the crashed server up immediately, so I trie...

Relational database question with php.

Hi, Not really a coding question more a little help with my idea of a Relational database. If I have 3 tables in a SQL database. In my php script I basically query the companies which are in industry "a" and then insert a row into a separate table with their details such as companyId , companyName etc is that a type of Relational data...

how to validate username and password in vb6?

i have created a database in mysql5.0. i want to display the data from it. it has table named login. it has 2 columns username and password. in form i have 2 text fields username and password i just want to validate input with database values and display message box. connection from vb to database is established successfully. but its not...

HELP,PLEASE,values not updating from PHP AJAX form to MYSQL database

Hi all and thanks in advance to all for this I tired searching the entire forum and was unable to find the answer i was looking for so i decided to post a new thread, if a thread explaining this already exists than i'm sorry for not finding it and posting there. any how my problem is that i am unable to update the values enterd in the ...

vb6 displaying problem

i have created a database in mysql5.0. i want to display the data from it. it has table named login. it has 2 columns username and password. in form i have 2 text fields username and password i just want to validate input with database values and display message box. connection from vb to database is established successfully. but its not...

wordpress query

How do I query posts from a category using more than 1 custom key/value pair? ...

MySQL: select words as rows even som are "new line" separated in one field

Hi I have a table with a field where words are written separated with new lines. So a select on this single field from to rows will output 3 lines for first row and 2 lines for second row: Row1 designationer nye kolonier mindre byer Row2 udsteder bopladser I would like to do a select that select all thes...