mysql

ClientAbortException: java.net.SocketException: Connection reset by peer: socket write

Hi, I am using MySQL 5.1 and my connector version is mysql-connector-java-5.1.7. I am getting following exception frequently. What is the issue? Dec 24, 2009 10:29:20 AM org.apache.catalina.core.StandardHostValve status WARNING: Exception Processing ErrorPage[errorCode=404, location=/error.jsp] ClientAbortException: java.net.SocketExce...

Dynamic Template Sheet?

I have 5 game sections that will use the same template sheet, but they will all pull data from a different table in mysql in the same database. However, I am incorporating this: http://stackoverflow.com/questions/1712973/how-to-include-config-php-efficiently/1713000#1713000 Okay, so here's how I was planning to tackle it. For example, ...

Should I put my entire site on one database or split into two databases?

My webapp that I am developing will incorporate a forum (phpbb3 or smf), a wiki (doku wiki flat file storage), and my main web app. All of these will share a User table. The forum I expect to see moderate usage (roughly 200 posts a day) to begin with and will increase from there. The main web app will be used heavily with triggers, mysq...

Primary key as INT and global key as GUID for improved performance.

Hello. While deciding upon the keys for a table, is it good to have an INT primary key (autoincrement) for the table and a GUID (in addition to the INT) for the scope of the database? Given that there will be more table DML statements it will be faster to operate on INT whereas if any pan-database DMLs statements are to be executed, GUID...

How to judge whether or not a transaction succeeded or failed?

I'm using MySQL and PHP. Running this transaction: begin; .... commit; How should I judge whether it failed in PHP? ...

PHP based MySQL database managers

I'm looking to some lightweight open source php based MySQL database managing script. I would essentially prefer something that is packed into a single file, and has a decent UI and features. PS: I already know about PHPMiniAdmin, I'm looking for alternatives. ...

Why these two statements have different results?

mysql> select a.id,a.parent from qa a left join qa b on a.parent=b.parent where b.id=7; +----+--------+ | id | parent | +----+--------+ | 7 | 1 | | 8 | 1 | | 9 | 1 | +----+--------+ 3 rows in set (0.00 sec) mysql> select a.id,a.parent from qa a left join qa b on a.parent=b.parent and b.id=7; +----+--------+ | id | pare...

mysql's current_timestamp for java derby

Hi all, In MySQL I can easily set the default value of a timestamp field to be the current time fieldname timestamp not null default current_timestamp Does anyone know how to do the same thing in java derby? ...

How bad is it to change the structure of big tables?

My target DB is MySQL, but lets try to look at this problem more "generic". I am about to create a framework that will modify table structures as needed. Tables may contain a hundred thousands of records some day. I might add a column, rename a column, or even change the type of a column (lets assume that's nothing impossible, i.e. I mig...

How to check whether column value is null or 0 in PHP?

$query = 'select column from table ...'; ... $row = mysql_fetch_assoc($result); //now i have the result //but how to check if it's null or 0? ...

How do I tell DBD::mysql where mysql.sock is?

Using DBD::mysql with DBI, I am getting the following error when attempting to connect to the database. DBI connect('database=mydb:host=localhost','someuser',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at ./myscript.pl line 97 Yes MySQL is up and running. The problem is that mysql.sock is ...

Using AUTO_INCREMENT in MYSQL

Why do I get the following exception when I did this, what mistake did i made? What is the right way to insert tuple into tables with AUTO_INCREMENT fields? How about delete, is it possible to update the ids? string connStr = "server=localhost;user=root;database=test;port=3306;password=XXX;"; MySqlConnection conn = new MySqlConnection(c...

I am accessing a MySQL database using the .NET connector and getting the error "Guid should contain 32 digits and 4 dashes"

I have a .NET application which allows users to access various databases by providing a connection string and a provider. One of the databases which users want to access is a MySQL database (not mine so I can't change it) where the primary keys are all stored as GUIDs. My application can access records in various tables in that databas...

problem persisting xml in Mysql using hibernate

Hi, I am trying to persist a string object in Mysql(5.0.67) using hibernate. My entity is as follows: @Entity @Table(name = "info", schema = "DB") public class info { @Column(name = "InfoXml") private String InfoXml; } The problem is when I persist the xml with value: String InfoXml = "<?xml version="1.0" encoding="UTF-8" standalon...

Is it OK to run the WHILE loops in MySQL?

Is it ok to a mysql query inside a while loop using the ID of each row passed to fetch results from another table? OR is there a better way to do it? $q = $__FROG_CONN__->query("SELECT cms_page.id, cms_page.title, cms_page.slug, cms_page_part.* FROM cms_page LEFT JOIN cms_page_part ON cms_page_part.page_id=cms_page.id WHERE cms_page.pa...

Convert mysql SQL to oracle SQL

Hi, Is there a Free tool to convert MySql-5.0 SQL to Oracle-10g SQL? thanx in advance,,, ...

SQlite synchronization scheme

Hi, I know it is xmas eve, so it is a perfect time to find hardcore programers online :). I have a sqlite db fiel that contains over 10 K record, I generate the db from a mysql database, I have built the sqlite db within my iphone application the usual way. The records contains information about products and their prices, shops and the...

PHP Inbox Function

I received some great help on my last question. Here is where I'm at: I'm on the very last step of building a threaded messaging system for a dating website project for school and want to highlight a with a different bg color when a message is new. This is the table structure: CREATE TABLE `messages` ( `id` bigint (20) NOT NULL A...

Using a combination of InnoDB and MyIsam tables

I have 2 tables in which I want more robustness and fortunately don't require frequent rapid fulls of data and examination. All other tables would inevitably be MyISAM. Can I safely use both (I've read a handful of discouragements from this) without fearing bugs or data getting affected by differences between engines? ...

Pagination of Multiple Models in CakePHP 1.2.5

I'm working on a view for a blog that mixes blog posts, comments, and uploaded media items into one large grid layout. I've set up the individual models in CakePHP and the associations, some of which are as follows: Comment BelongsTo Post or Media Post HasMany Media What I'm working with is trying to sort all three models (Comment, M...