mysql

MySQL cloud transaction accounting per user?

We are expanding our hosting capabilities and want to provide MySQL database access in a large shared environment (think cloud services) - our goal is to charge per transaction per user similar to Amazon's EC2 services. What mechanisms are available for this type of DB accounting in MySQL? ...

Insert 'Text' field data type into MySQL using EJB 3

private String message = ""; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } I am using EJB3 and MySQL 5.1 using Java. I want to insert paragraphs of texts into MySQL Database using Entity Bean. But, When I add, MySQL can accept only 255 characters. It shows m...

Can mysql handle a dataset of 50gb ?

Can mysql handle a dataset of 50gb (only text) efficiently ? If not, what database technologies should I use ? thanks ...

What's the proper way of joining tables in mysql

How do I get to make this sqsl query work: SELECT student.LASTNAME, student.FIRSTNAME, student.IDNO, student.YEAR, parents.P_ADDRESS FROM student WHERE P_ADDRESS="Ambagat, Santol, LU" RIGHT JOIN parents ON student.IDNO = parents.IDNO I just want to add where statement on the joins. Because the usual example...

MySQL - Matching 2 rows (or more!) within a sub-query/table

I have this schema which I need to match 2 rows from user_data : user_id, field_id, value A sample output would be: user_id field_id value ----------------------------- 1 1 Gandalf 1 2 Glamdring How do I write a query which basically say "Find the user id of the user whose field_id 1 is...

How should I import my legacy MYSQL db into my new Django project which will use Postgres?

I currently have a site which uses a MySQL 4.x schema, the site uses PHP for the backend. I'm currently in Django-land and I like Postgres so far ( meaning I'm a noob to both ). What would be the easiest way to go about importing the data in my tables ( the dump file for the entire DB is around ~200 MB ) into my new project? I currently...

How can I benchmark/profile my PHP/MYSQL news site in order such I can compare it later on with a django/postgres recoded version?

I'm looking for some type of profiling utility I could use where I can compare between 2 different setups with some sort of consistency factor. Would appreciate if anyone could point me in the right direction. ...

How to Create a MySql Database using JDBC

Hi, Can we create a new MySQL database( not a table, I want a new database) from java code ? I have searched the internet and I get code only for connecting with existing mysql databases. Can i create a new database at run time using java code. please help ...

mySQL Variables in SELECT

Is it possible to have a query such as the following: SELECT @threadIDvar = `threads`.`id` AS `threadID`, (SELECT `posts`.`timeDate` FROM `posts` WHERE `posts`.`threadID` = @threadIDvar) AS `postDate` FROM `threads` INNER JOIN `posts` ON `posts`.`threadID` = `threads`.`id` WHERE `threads`.`boardID` = 1 I have tried it but I get @threa...

How to use ORDER BY with proper handling of numbers?

I want to get data from mysql table sorted by one of it's varchar column. So let's say I have query like this: SELECT name, model FROM vehicle ORDER BY model The problem is, that for 'model' values like these: 'S 43', 'S 111' the order will be: S 111 S 43 because I suppose ORDER BY uses alphabetic order rules, right? So how to modi...

Convert DateTime Value into String in Mysql

I want to convert Date & time value into varchar and then store in database I am fetching the Current Date & time using NOW() in mysql and now want to convert it in string because i have to merge this value with String value ...

MySql LINK to SQL Server

I have a host with php+mysql and i need to run a script here to register accounts to another host that has SQL Server and i also have php+mysql here also , but i need the accounts to be in SQL Server. how can i do this? ...

MPTT to select root element mysql

Hi, What mysql query should i use to select root elements? Let's say i have tree structure like this: http://www.ipix.lt/desc/18496369 And i want to select (Vaisiai, Daržovės) elements. ...

Using "includes" in an OO PHP Class

I have a class that inserts information into a MySQL database. I have the connection variables set as fields at the top of the class. When I run the class it works perfectly. I would like to simply store the class fields in a separate file (not a class but just the fields saved in a file) and include it inside my class. when I do this ...

mySQL table linking , group linked to other members lists, the displaying all members

I have a database with a group(g1) and a list of members(m1), by itself it works fine. However I want to add the ability of the group(g1) to add different groups(g2-3) to it's list so that a query would bring up ALL the members(M1)+(m2-3) as a result. My tables are: Group(1) Table: Group1, Member(2) table: MemberA, MemberB, MemberC...

How to write MySQL full-text query with MATCH(), ROUND() & Subquery?

Currently, I am using this query, which does a pretty good job of finding the most relevant results and ordering by "most relevant" first: SELECT *, MATCH(text) AGAINST('$keyword') AS score FROM table_name WHERE MATCH(text) AGAINST('$keyword') ORDER BY score DESC LIMIT $s, 20 Which produces results like: text ...

Comparing with NULL values

CREATE TABLE `mycompare` ( `name` varchar(100) default NULL, `fname` varchar(100) default NULL, `mname` varchar(100) default NULL, `lname` varchar(100) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO `mycompare` VALUES('amar', 'ajay', 'shankar', NULL); INSERT INTO `mycompare` VALUES('akbar', 'bhai', 'aslam', 'akba...

php/mysql creating duplicate records with multiple tables

I'm building a database for making hotel reservations. One table called "reservations" holds the general details of the reservation, while another called "rooms" holds details about specific rooms (each reservation has many rooms, each room belongs to only one reservation). I would like to be able to easily generate duplicate reservati...

Books for experienced .NET developer learning PHP/MySQL

Hi All, I am an experienced .NET developer (C#/ASP.NET) looking to broaden my skills to the PHP/MySQL arena. I would like get recommendations on books for learning PHP/MySQL that are geared towards someone who is already familiar with object oriented programming and web development. I do realize that there are lots of online material ou...

Unable to initialize provider. Missing or incorrect schema. for MySql.Web connector

Hey guys and gals running into a little issue here.. I'm trying to use MySql Connector 6.2.2.0 for membership and role providers.. The issue I'm having is: Unable to initialize provider. Missing or incorrect schema. <authentication mode="Forms"/> <roleManager defaultProvider="MySqlRoleProvider" enabled="true" cacheRolesInCook...