mysql,replication,database-replication,master-slaveRelated issues-Collection of common programming errors


  • Msonic
    c# asp.net mysql
    I’m building very simple search engine for a job site. It has 3 optional input fields, term, category and employer. Term and employer fields are text input and category is dropdown list. Search logic is very stupid, complicated and not scalable but this search is meant to be used just one time and all i need from it is that it works on a few cases and since i have more important things to do at the time i didn’t tried to make it any better. This is the method that returns a DataSet with results

  • Lightness Races in Orbit
    mysql null zero
    (I’m using MySQL 5.1.)Insert looks like this:INSERT INTO foo (bar) VALUES (”);bar field was created as so: bar INT(11) COLLATION: (NULL) NULL: YES DEFAULT: (NULL)Shouldn’t an empty string be inserting a NULL? Not sure why I’m seeing a zero (0) being stored in the table.

  • Seven
    mysql cakephp-2.1
    I created a site with CakePHP responsible for displaying my CV. I would like to add a new feature relying on that if i still work at some company it should display text: “until now”, if dont it should display a proper date. The problem is that when I adding a new column to my database named isActive and I set up value 1 to one of the entries (other entries have value 0) page displays value 0 for all entries. This problem occurs on production server. On my development server everything is ok.View

  • Jader Dias
    mysql geospatial
    I want to get the length in meters between 2 points in the surface of the Earth. But the GLength method returns an unexpected valuehttp://dev.mysql.com/doc/refman/5.0/en/geometry-property-functions.html#function_glengthSELECT GLength(GeomFromText(‘LINESTRING(-67.8246 -10.0073,-67.8236 -10.0082)’, 4326))actual result0.00134536240471071expected value in meters:147

  • Konstantin V. Salikhov
    java mysql hibernate jpa eclipselink
    I used NanedQueries (as follows) in my JPA project Eclipselink as persistence provider:@Entity @Table(name = “login”) @NamedQueries({@NamedQuery(name = “Login.random”, query = “SELECT l FROM Login l WHERE l.pk = :randomPk”),@NamedQuery(name = “Login.max”, query = “SELECT MAX(l.pk) FROM Login l”) })But after I change Hibernate as my persistence provider, I get the following error:java.lang.IllegalArgumentException: org.hibernate.QueryException: unexpected char: ‘{‘ [SELECT…I use Hibernate 3.2.5

  • mcgrailm
    php jquery mysql jquery-ajax jquery-selectbox
    Today I realised it’s pretty usefull when one combobox can control the data of the second combobox. My problem -> I’ve never worked with Ajax before.Currently working on the following webpage: http://194.247.30.66/~keizer/?ond=woningenTry to use the comboboxes on the left.My general question: I hate submit buttons, I hate a default look, how can I use Ajax to handle the data of the second combobox? For example: The first combobox contains a list of city’s. When I select a city, it should automat

  • Christian Wibowo
    php mysql insert
    i want to insert array to mysql db using php..and now i getting error with this code :$insert_sql = sprintf(“INSERT INTO detail_paket (id_paket, menu_paket) selectpaket.id,\’%s\’ from paket where paket.nama_paket=’$nama_paket'”,%data1[$i]);^| here is the error syntaxdata1 is the array..what is the correct syntax to use \’%s\’ ?when i trying to run the query, the error info show : syntax error, unexpected ‘%’ in or syntax error unexpected “” in*.i already tried using \”%s\ and \”%s”\ and %s and

  • R.S
    php html mysql
    Possible Duplicate:Parse error: syntax error, unexpected T_STRING 59 I have a database with names that I would like displayed in the form of a table with checkboxes. Everything works until I try to place the html tag into my php code. When I put the input tag in it gives me the error: Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’I can’t see where I would put a comma or semi colon.<form><?php$name = $_POST[‘name’];$host = “mysql16.000webhost.com”;$user_name = “

  • user1023768
    mysql transactions insert innodb myisam
    I have a MySQL table implementing a mail queue, and I use it also to send mails which reports unexpected errors in the system. Sometimes these unexcepted errors ocurrs inside a transaction so when I rollback the transacion also I undo the row inserted (the mail which is reporting the unexpected error) in the mail queue table.My question is how can I force to insert a row in a table in the middle a transaction ignoring the possible transaction rollback?. I mean, If the transactions finally rollsb

  • Balaji Reddy
    mysql hibernate jpa
    Using JPA and mysql,I want to write program for delete and insert into a table in single transaction using @Transaction annotationMy code is like this//Delete entityManager.createNamedQuery( “DELETE_QUERY” ).setParameter( “userId”, userId ).executeUpdate();entityManager.flush();//InsertUser user = new User(); user.setUserId(122); user.setPassword(“test”);entityManager.merge( user ); entityManager.flush();Delete query is displayed. Then the update query is running here…Then it throw the below

  • slm
    centos rhel migration duplicate replication
    We currently have our website and website’s CMS hosted on a dedicated host which runs Red Hat. We want to remove Red Hat and install CentOS instead.My question: is there a straight forward way of replicating all the server settings, PHP, Apache, SQL data, website files, and CMS settings from the Red Hat install, and moving them over to a new CentOS install?To make things easier, I don’t mind installing the equivalent version of CentOS, based on the Red Hat version we currently have. So if we h

  • Geesu
    postgresql replication
    I currently have 1 master server (a) and 3 replication servers (b, c, d) that come directly from the master, the archive_command I use is the following script: https://gist.github.com/Geesu/8640616All servers are Ubuntu 12.04.4 running PostgreSQL 9.2.6And here is the recovery.conf for each of the replication servers: https://gist.github.com/Geesu/8640635What’s strange is about 6 hours after I started the replication servers, 2 of them immediately fell behind and are now stuck trying to catch up,

  • Zak
    mysql vmware-esxi replication cloud
    We currently are in the research phase of building a “Master” database for our e-commerce business that will centralize all data, including product information, vendor information, Magento information, Amazon, etc …. We have looked into both “physical hardware” (Two RAID 5 machines, master/slave, with a HDD backup off the slave — and a separate application server)…. Or we could do a “cloud based” system.The heart of the question is, is there any benefit with replicating on a cloud? Th

  • jabley
    mysql replication disaster-recovery mysql-replication
    After a power outage at our data centre, the slave MySQL databases are struggling.This is in the logs for one of the slaves:100118 10:05:56 [Note] Slave I/O thread: connected to master ‘repl@db1:3306’, replication started in log ‘bin-log.004712’ at position 724207814 100118 10:05:56 [ERROR] Error reading packet from server: Client requested master to start replication from impossible position ( server_errno=1236) 100118 10:05:56 [ERROR] Got fatal error 1236: ‘Client requested master to start re

  • Rafal Dowgird
    mysql replication mysql-replication
    When issuing START SLAVE UNTIL on MySQL , I’m getting the following:Warning: It is recommended to use –skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave’s mysqld restart.Why exactly is it recommended to use –skip-slave-start? What happens if the slave indeed restarts – does it only forget the UNTIL part and replicates till the end of binlog?

  • RolandoMySQLDBA
    mysql replication mysql-5.5 mysql-5
    I have a question about deleting binary logs in the replication environment:We have an environment with 1 master and 2 slaves (running mysql 5.5). Sometimes, we run into a space issues during heavy processing times, whereby bin log directory gets full. Logs are expired every 3 days. I was wondering, is there a reason why logs should be kept for 3 days on all the boxes – master and both slaves? Would it make sense to, for example, keep logs for 3 days on a master, but for 1 day on slaves? What is

  • com
    mysql replication
    I get a lot of following messagesUnsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Statement:I don’t really understand why this happens. According to messages, it happens because in the code I try to INSERT and UPDATE Innodb table and MyISAM table. Is it right?Is this dangerous? What’s the consequences of this error.

  • KajMagnus
    postgresql replication
    I’ve configured master slave replication in PostgreSQL, following this tutorial: http://wiki.postgresql.org/wiki/Binary_Replication_Tutorial#Binary_Replication_in_6_StepsIt worked fine. Now I’ve promoted the slave, and configured the original master to be a slave to the new master, again following the tutorial linked above.However, replication no longer works. The new slave (i.e. the former master) logs errors like:FATAL: terminating walreceiver process due to administrator command LOG: out-o

  • Niels Kristian
    postgresql replication
    I have a streaming replication hot-standby setup, which seems to be running all good. I can login, execute selects and the result seems to be up-to-date with the master. However in the log of the standby, I see a lot of these:cp: cannot stat `/mnt/wal_drive/wals/0000000100004BA800000070′: No such file or directory 2014-02-28 16:00:37 CET LOG: record with zero length at 4BA8/70DD79D0 2014-02-28 16:00:37 CET LOG: started streaming WAL from primary at 4BA8/70000000 on timeline 1 2014-02-28 16:02:

  • ivica
    replication mongodb permissions
    I’m having some trouble with intentionally removing a secondary from a replica set. I’m trying to simulate unexpected shutdown.My replica set consists of one primary and 2 secondaries. When I shut down the mongo instance on one of the secondaries and try to restart the service it fails with the message from the log which states:Tue Dec 24 12:20:08.882 [initandlisten] couldn’t open /var/lib/mongo/maars.ns errno:13 Permission deniedSimple chown -R mongod /var/lib/mongo solves the problem, but this

  • vaan38
    mysql database-replication
    I just configure 2 mySQL servers for a MASTER-MASTER replication. I choose the RBR replication for some reason.My congifuration on the server ONE :#replication server-id=1 binlog_do_db = db1 binlog_ignore_db = db2 log-bin=”C:/ProgramData/MySQL/my56″ auto_increment_increment = 2 auto_increment_offset = 1 binlog_format=ROW replicate_do_db=db1and on the server TWO :#replication server-id=2 binlog_do_db = db1 log-bin=”C:/ProgramData/MySQL/my56″ auto_increment_increment = 2 auto_increment_offset = 2

  • Julio Garcia
    database postgresql database-replication postgresql-9.1
    I am trying to set up synchronous replication with Postgres 9.1, but I cannot get it to work. I was able to configure streaming replication, but not synchronous. I hope I have not missed anything obvious. I have read carefully many sections of ch 17, 18, 14, 25, 26 and 29 in the admin guide.I am running ubuntu 12.04 and my master postgresql.conf has these, among all the other standard settings:listen_addresses = ‘*’ # what IP address(es) to listen on; wal_level = archive

  • Chad Johnson
    mysql database-replication
    We started using Multi-Master Replication Manager for MySQL, and I am wondering whether it is possible to to treat this setup like multi-symmetric processing: a process pops off the process queue, and the node (in this case a server) that is most free is selected for the job.It seems that what happens is, the service switches to a slave ONLY when it mysqld crashes or goes away.Is there a way to make database replication for MySQL act in more of a distributed manner? Maybe there is other software

  • user805627
    c database mongodb database-replication mongodb-c
    In this simple program, I want to reconnect to replica set when the primary node crash. But it doesn’t work: if the primary node crash, this program will be terminated immediately without any output, and return 141. I don’t know why. What is the proper way to reconnect to replica set?#include <stdio.h> #include <mongo.h>int insertVal(mongo *conn, int val) {bson op[1];bson_init(op);bson_append_int(op, “val”, val);bson_finish(op);int status = mongo_insert(conn, “test.vals”, op, NULL);b

  • QA Automator
    mysql database-replication
    We have a MySQL setup running a single master and two replication slaves. We recently ran into a scenario where SlaveIO had stopped on one of the replication slaves and SlaveSQL had stopped on the other replication slave. This had silently stopped replication on both slave servers. I decided to write a monitoring plugin for Nagios to keep an eye on the status of SlaveIO and SlaveSQL. The problem I am having is emulating the scenarios we ran into above. I can issue a “STOP SLAVE” command to stop

  • tamirko
    mysql replication database-replication master-slave
    Here’s the scenario: I have one MySQL Master and 1 slave. master-slave replication is set and works perfectly. The slave machine crashes. The master machine is still up and running. Nothing changes in the master DB. I start the slave machine again. I start the slave MySQL DB.Do I need to invoke “start slave” again on the slave DB ? 10x.

  • juwi
    emailserver postgresql replication database-replication
    I’m currently planning a more fault tolerant setup for my organizations Mail setup. We currently have two machines available in different datacenters, that we’re planning to use for this, one being a physical host, the other being an lxc “VM”. The plan is to make the Physical host our primary Mailserver (lets call it server1) and the VM (lets call that server2) the secondary via DNS, so that when server1 goes down, server2 could take over until we’ve got the other one up and running again.As wit

  • methanol
    mysql database replication database-replication master-slave
    I am about to do a MySQL replication for my typo3 Database. There are two servers. You guessed it one is the Master and one is the Slave.Master my.cnf:[mysql] server-id = 1 log-bin expire_logs_days = 21 max_binlog_size = 500M binlog-ignore-db=mysqlSlave my.cnf:[mysql] server-id = 2 binlog-ignore-db = mysql replicate-ignore-db = mysql auto-increment-offset = 1 expire_logs_days = 21 max_binlog_size = 500MUser on Master: repl@slaveip REPLICATION SLAVE, REPLICATION CLIENT User on Slave: repl@maste

  • pkyeck
    mongodb node.js database-replication mongoose
    i have installed mongodb (1.8.3) on two seperate servers and set them up to use “replica sets” as found here: http://www.mongodb.org/display/DOCS/Replica+Set+Tutorialeverything looks good so far: one server is recognized as primary, one as secondary (when i access them via commandline).the problem is that i can’t connect to the DB using node.js (0.4.10) and mongoose (2.1.0) like this:var mongo = require(‘mongoose’); mongo.connectSet(‘mongodb://host/dbname,mongodb://host2/dbname’);i always get th

  • Rajesh Chamarthi
    oracle database-replication
    I am trying to run an initial load as shown in the tutorial at http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/goldengate/11g/GGS_Sect_Config_WinUX_ORA_to_WinUX_ORA.pdf and I am seeing this error in the REPLICAT process.I have tried using the SOURCEDEFS clause as well (Even though the source and Target structures are exactly similar), but I run into the same issue.** Run Time Messages **2011-04-14 12:02:15 GGS ERROR 171 Unknown data type received <0x54 49>.The only other Indi

  • snøreven
    redundancy redis master-slave
    I am using redis as a cache server. Can I somehow configure multiple redis servers, that the cache is fully functional (read/write) even if some of them go offline?I looked into master->slave, but the problem I see there is, that if the master fails, and I allow writes to the slaves, they get overwritten once the master is up again. Now the master just serves the old data.The only solution I could come up was disabling write-to-disc, but that sucks as I loose everything if I have to restart the

  • tamirko
    mysql replication database-replication master-slave
    Here’s the scenario: I have one MySQL Master and 1 slave. master-slave replication is set and works perfectly. The slave machine crashes. The master machine is still up and running. Nothing changes in the master DB. I start the slave machine again. I start the slave MySQL DB.Do I need to invoke “start slave” again on the slave DB ? 10x.

  • aneez
    postgresql master-slave pgpool2
    I am trying to configure pgpool2 and postgresql 9.1 to handle failover.I currently have streaming replication running, and are using pgpool2 for read-only load balancing. I have 2 servers in my setup, both running postgresql – 1 master and 1 slave. The master is also running pgpool2.My question is how do I configure this setup to handle failover? Specifically in the case that the master crashes, and the slave has to take over and run pgpool2 as well. Most documentation and examples I have been a

  • Eric DANNIELOU
    linux database oracle11g ulimit master-slave
    Is there an issue with “Ulimit -Hn” being set too low (at 1024) when (Oracle recommend 65536)? This is for Oracle 64-bit 11g on Linux 5.It is one of the settings that appears to be woefully short of its recommendation. But I am also aware that the database server in question is an Oracle Data Guard Local Standby and should only really have a connection or two from its Primary database server (to ship the redo logs across).The Local Standby database server has ‘hung’ about 3 times in as many mon

  • methanol
    mysql database replication database-replication master-slave
    I am about to do a MySQL replication for my typo3 Database. There are two servers. You guessed it one is the Master and one is the Slave.Master my.cnf:[mysql] server-id = 1 log-bin expire_logs_days = 21 max_binlog_size = 500M binlog-ignore-db=mysqlSlave my.cnf:[mysql] server-id = 2 binlog-ignore-db = mysql replicate-ignore-db = mysql auto-increment-offset = 1 expire_logs_days = 21 max_binlog_size = 500MUser on Master: repl@slaveip REPLICATION SLAVE, REPLICATION CLIENT User on Slave: repl@maste

  • Sarah Ryan
    bind master-slave zone
    UPDATE:BIND Version:[[email protected]] $ named -v BIND 9.3.6-P1-RedHat-9.3.6-16.P1.el5Operating System:CentOS release 5.6 (Final)After running [[email protected]] $ dig @10.224.45.130 example.com. axfr:Slave:; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> @10.224.45.130 example.com. axfr ; (1 server found) ;; global options: printcmd ; Transfer failed.Master:28-Aug-2011 12:29:01.384 client 10.224.45.131#60553: query: example.com IN AXFR – 28-Aug-2011 12:29:01.384 clie

  • parvus
    windows jenkins master-slave
    I set up Jenkins on a Windows 7 64 bit PC, and installed a Jenkins slave service on another Win7 64 PC. The master PC gives this error:Connection was broken java.net.SocketException: Connection resetat java.net.SocketInputStream.read(Unknown Source)at java.io.BufferedInputStream.fill(Unknown Source)at java.io.BufferedInputStream.read(Unknown Source)at java.io.ObjectInputStream$PeekInputStream.peek(Unknown Source)at java.io.ObjectInputStream$BlockDataInputStream.peek(Unknown Source)at java.io.Obj

  • Alaa
    mysql innodb master-slave
    I have mysql DB on server S1 (mysql version 5.1.41-3ubuntu12.7-log), i have created master-slave for this DB on server S2 (mysql version 5.1.54-1ubuntu4-log). the DB on S1 was using one data file (ibdata). after dumping the DB to S2 i set innodb_file_per_table=1. this made every table to have its own ibd file. now everything went fine and smoothly. but after restarting mysql on S2, i faced a problem with getting this error: Error ‘Unknown table engine ‘InnoDB” on query. Default database: MyDB a

Web site is in building