Hi all,
I want to load balance queries to 2 mysql servers, in my application.
What would be the best way to do that, so that each query goes to a different db server?
I am thinking of having a global counter which is incremented each time a connection is made, mod the counter with my db servers in order to get the host I should connec...
I'm trying to understand why the following is failing and I'm not able to see it. The phpMyAdmin on our development server generated this exactly, but when I try importing it - I'm running into a weird parsing(?) error.
mysql> DELIMITER $$
mysql>
mysql> --
mysql> -- Functions
mysql> --
mysql> DROP FUNCTION IF EXISTS `get_class_nextsessi...
I am working on a website project. We have a MySql and a MongoDb base.
We want to add a full-text search-engine over these bases (and if it can be linked with PostgreSql it's better).
These databases contain multilingual texts but we cannot determine the language.
I saw Solr, ElasticSearch and Sphinx, but what is your advice on this ...
Hi,
SUBSTRING_INDEX() in MySQL returns a substring from a string before the specified number of occurrences of the delimiter.
Is there any equivalent function in JavaScript? I need to perform the same thing.. but on a string value in JavaScript.
...
So I setup a table using mysql query browser, and now i'm trying to fill it up. But no matter what I do, it says "created account succesfully", but nothing ever gets added to the database!
The code I have is below:
`
if($connection)
{
$out =
"<p>Please wait while we process ...
All,
We are evaluating MySql as a lower cost alternative to SQL server for our smaller clients in a shared hosting environment. I am still foggy on how we would migrate some of the particulars such as table/scalar value functions, sql jobs, etc, but I will post specifics in another thread. I do, however, have a fundamental question ab...
Is there going to be any real benefit to me putting indexes onto date fields that are going to be mainly used in queries using stuff like.
dateField < 'var'
And
'var' BETWEEN dateField1 AND dateField2
The searches get done a lot but I am never doing a direct comparison "=" on them.
...
Hello everyone,
I'm having troubles with certain query performance, i have the following 2 tables:
CREATE TABLE `customers` (
`CustFullName` varchar(45) NOT NULL,
`CustPassword` varchar(45) NOT NULL,
`CustEmail` varchar(128) NOT NULL,
`SocialNetworkId` tinyint(4) NOT NULL,
`CustUID` varchar(64) CHARACTER SET ascii NOT NULL,
...
... where "missing records" are identical to the last recorded value, hence no record.
This may be subjective, but I'm hoping there's a standardised way of doing this.
So, let's say I have a bunch of analytics in a MySQL table. There is some missing information, but as mentioned above, that's because their previous value is the same as...
I need to select a row from table that has more than 5 millions of rows. It is table of all IP ranges. Every row has columns upperbound and lowerbound. All are bigintegers, and the number is integer representation of IP address.
The select is:
select *
from iptocity
where lowerbound < 3529167967
and upperbound >= 3529167967
...
I have a 250 MB backup SQL file but the limit on the new hosting is only 100 MB ...
Is there a program that let's you split an SQL file into multiple SQL files?
...
I have a warehouse table that looks like this:
CREATE TABLE Warehouse (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
eventId BIGINT(20) UNSIGNED NOT NULL,
groupId BIGINT(20) NOT NULL,
activityId BIGINT(20) UNSIGNED NOT NULL,
... many more ids,
"txtProperty1" VARCHAR(255),
"txtProperty2" VARCHAR(255),
"txtProperty3" VA...
I have 2 MySQL dump files. I want to find the table data difference between 2 tables.
...
Could I get some opinions on this MySQL table structure please?
Is the amount of varchar fields bad? Are there better alternatives?
The kind of data should be fairly self-explanatory.
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`active` bit(1) NOT NULL DEFAULT b'1',
`email` varchar(64) NOT NULL,
`passw...
Morning,
I'm having some trouble creating tables/loading fixtures.
(symfony 1.4.6 with the bundled Doctrine 1.2.3(?))
Tables (simplified):
Horseman:
tableName: Horseman
actAs: { Timestampable: ~ }
columns:
id: { type: integer(4), primary: true, autoincrement: true, unsigned: true }
name: { type: st...
Hi,
I'm using nested set model for my menu tree, and I'm trying to get nodes with some filtering. I have several root nodes.
Example:
Menu1(on)
\-Submenu1(on)
\-Submenu2(on)
Menu2(off)
\-Submenu3(on)
\-Submenu4(on)
\-Submenu5(on)
Menu3(on)
I want to return all nodes "on" but not the ones that have parents "off".
The query, f...
So in rails I use sqlite3 for development and mysql for production. Sqlite3 and mysql handle booleans differently ("t" or "f" in sqlite3 and true or false on mysql). Usually it's not a problem when I do a find because I can do this:
Comment.find(:all, :conditions => ["viewed = ?", false])
And rails will insert the appropriate value de...
I have a query I turned into a view that works OK. But the site_phrase sp table seems to be not using a column and goes through all the records in the table. Why is that? Here is the query:
EXPLAIN SELECT
`p`.`id` AS `id`,
`p`.`text` AS `phrase`,
`p`.`ignored` AS `igno...
General Case
How do you perform a left join across a many-to-many relationship when you want to add a condition to the foreign side of the relation?
Specific Case
We're dealing with two tables: team and pool. There is also a team_pool table serving as a many-to-many junction table between them. Additionally, a pool has a stage_id colu...
I am going back though a web-based document numbering system from few weeks ago. To sum it up, the user types in the project,class,base, and dash number (PPP-CCC-BBBB-DDD) then it is added to a mysql database. Now most doc numbers go in order according to revisions. IE: A document 1465-630-0001-000 becomes, after revision, 1465-630-0002-...