mysql

mysql error log

I removed the error log file from the data directory. I have not specified any path for the error log in my.cnf file. There seems to be no error log file available. Where does mysql now writing the log? ...

Does MySQL support check constraint?

Does MySQL support check constraint? I am able to execute the following script in MySQL without error. ALTER TABLE EMP_DB_DESIGN_EXCEL ADD ( CONSTRAINT CHK_EMP_IS_ACTIVE CHECK (IS_ACTIVE IN ('Y','N'))); But it is not reflected if I query: SELECT * FROM information_schema.TABLE_CONSTRAINTS T where t.table_name='EMP_DB_DESIGN_EX...

Catching errors from server side.

Hello, I am getting json data from my server to show them as a table. $('#queryFrom').ajaxForm({ dataType: 'json', beforeSubmit: showRequest, // pre-submit callback success: processJson, e...

How to combine two rows based on timestamps

So i know this is an odd way of doing it but ill try and explain. I have the following table trackingPoint{id, moduleId, lat, long, timestamp, first, last} I now have the problem where points might arrive out of order. The php that handles the entry generates a trip record but it relies on order. I could adapt this script but im lookin...

Hibernate inheritance with existing tables

Hi, I have 2 existing tables in my database. Let's call them Table and Chair for now. Both these tables are mapped as entities in Hibernate Both these tables have existed in my database for some time now, and they have their own, auto generated, ID's as primary keys. Now however, I want to group those entities under the very logical F...

Why doesn't PHP's MySQL driver cast datatypes?

I've pondered this for a long time, but I've never heard an explanation. I'm guessing that either MySQL's C API is simply not constructed to hand over data in its original type (which sounds like a design flaw), or the original mysql driver (replaced by the mysqli driver) was simply poorly designed and the mysqli driver was trying to be...

I got an error when starting mysql: Unable to lock ./ibdata1, error: 11

when removed the ibdata1 it worked, and I cant understand how it happened. I checked with ps and there was no mysql process. also permissions were ok. Is there a way to check the integrity of this file? ...

Select from mysql database json objects

I need to store a json string in database and to select entries depending on the values of json object. Is there any way to do this selection using mysql ? (i am using php, mysql 5.1) ...

I am using MySql database Can we get the information of last deadlock occur?

I am using MySql database Can we get the information of last deadlock occur? I mean does the information of deadlocks store in database?if yes Can we get them easily? ...

create array from mysql query php

Hi. I have a little problem that I don't understand. I have a db that has an owner and type (and more off course). I want to get a list of all the type values that has owner equal to the current user, but I get only two result $sql = "SELECT type FROM cars WHERE owner='".mysql_real_escape_string($_SESSION['username'])."' AND selling='0...

Mysql insert query

With Mysql tables like table_main id firstname lastname table_type id table_main_id table_type_id table_type id typename can a single sql insert query be contructed to run once with fields: firstname, lastname, typename values: john,doe,mytypename ...

Get Products from database

I'm trying to get all products from the database with a single query. I get stuck at the price part: VirtueMart has a table called #__vm_product and another one called #__vm_product_price. If a product has a parent product, it means that product inherits everything from the parent unless it's set different in the child. The tables loo...

database design normalization help needed (5nf)

Can you guys show me how to get this ERD in 5th normal form? We did a class assignment yesterday where we had a real client come in and explain to us his need my group came up with this model I am trying to take it a step further and see if I can get it to 5th normal form so that I can understand it better as next week we will be doing a...

Is it possible to use characters instead of a position in a substring function?

Hello all, is it possible to use characters instead of a position in a substring function? SELECT SUBSTRING(title,2) FROM table puts out every title starting with the second position. Now I want to cut the output after a space. The space positions varies. Is it realiseable? I tried sth. like SUBSTRING(title,2,LOCATE('',title)),but fo...

This SELECT query takes 180 seconds to finish

UPDATE: Just to mention it on a more visible place. When I changed IN for =, the query execution time went from 180 down to 0.00008 seconds. Ridiculous speed difference. This SQL query takes 180 seconds to finish! How is that possible? is there a way to optimize it to be faster? SELECT IdLawVersionValidFrom FROM question_law_versio...

how to connect mysql server using c?

how to connect mysql server using c? Any article related this? ...

double sorted selection from a single table

I have a table with an id as the primary key, and a description as another field. I want to first select the records that have the id<=4, sorted by description, then I want all the other records (id>4), sorted by description. Can't get there! ...

How to NOT select empty string

Hi. We have the following JPQL: Select distinct sys.ipAddress from SystemLog sys where sys.ipAddress is not null and sys.ipAddress is not empty And this generates the following mysql statement. select distinct systemlog0_.ipAddress as col_0_0_ from SystemLog systemlog0_ where ( systemlog0_.ipAddress is not nu...

php page can't load MySQL's database

Hi I'm having some problems while trying to connect a .php with mysql. here's the connection.php code <?php $db_host =$_POST['localhost']; $db_user =$_POST['root']; $db_password = ""; $db_name = "prtcl"; ?> and this is the page where I actually use the connection <? include("connection.php"); ?> ... <?php $db = mysql_connect($db_...

Unknown column error in MySQL (#1054)

This sql fails: select * from RRICallouts as r JOIN LevelToCalloutsJT as lc on ( `r.__kp_RecID` = `lc._kf_RecID~Callout` ) JOIN Levels as l ON ( `lc._kf_RecID~Level` = `l.__kp_RecID` ) where `l.__kp_RecID` = 201006221644060009 #1054 - Unknown column 'l.__kp_RecID' in 'where clause This works: select `__kp_RecID` from Le...