I am trying to achieve mysql replication between server1 and server2 with help from [url]
However, I have problem connecting server1 and server2 to perform the replication. The error that I receive during the first time replication on server2 is as below:-
mysql> LOAD DATA FROM MASTER;
ERROR 1218 (08S01): Error connecting to master: Access denied for user 'slave_user'@'server2' (using password: YES
However, I am able to connect from server2 to server 1 with:-
mysql -h server1 -u slave_user -p
I have followed the exact guides but still could not get it to work.
I don't know much about MySQL replication at all but am trying to present a few different options to a client of mine.
They run a large eCommerce site with a very active database. For several reasons, they are considering having their site mirrored across two completely different dedicated hosting providers.
The question here is, is it also possible to replicate the MySQL database in real-time across external servers and if/how secure it is.
Essentially, if one DC becomes inactive they'd like to fall-back on the other. An even more ideal solution would be to split traffic across the two... but not sure if that's even possible, perhaps with DNS?
I'm working for a client who has an e-commerce site currently hosted on a shared hosting solution.
He is now looking for 100% uptime (as near as), so I have suggested that we get 2 VPS and use DNS monitoring to switch servers as required (from DNSmadeEasy).
This is all fine, and the websites files/images do not change often, so I can use rsync every so often to sync these. Not a problem.
What does change frequently is the mySQL db for the site.
I've been looking at MySQL replication, but this seems to be no good. If one server goes down, then the other one takes over, they don't automatically sync themselves after they come back up. It seems MySQL cluster is best, but this needs 3 servers and they all need to be on the same LAN.
I've read you can set MySQL replication to MASTER-MASTER so that it acts like a cluster, and resyncs itself as required.
I had configured mysql replication for one of my client. Now the replication is stopped and slave server is not updating the data. How can I resolve this and start the replication again?
Some of you may have read my previous posts about a dual server configuration I am currently working with. I run a high traffic forum which has up to 2-3k of people online at once. I was wondering if it could be effective to setup MySQL Replication of certain tables which are read very frequently and then modifying the script to grab data from the slave server rather than the master? For say viewing threads, forums etc. Information which isn't updated literally every second.
A few questions...
-Will this place a lot of load on the master having to write the data to the slave as well? As in would the load I save on SELECT queries be used on writing to the slave anyway?
I'm not too experienced with this, so I'm hoping someone more enlightened here can help.
Scenario: I'm trying to build a social network site geared towards old people. I'm using LAMP environment. I want to have 1 mysql master (writes) and 2 mysql slaves (reads). Two web servers will read from the 2 mysql slaves and write to the one mysql master.
Questions: My concern is this: when a user posts a comment via the webserver, the comment is written to the mysql master. I would like for him/her to see the comment he posted right away so they don't think something failed or went wrong. I'm afraid that replication to the mysql slaves will take some time to sync all of the mysql databases together. How can I work around this? Or am I mistaken and this doesn't actually happen?
How fast is replication? How can I mitigate this delay in replication to show the user instant results of their submission.
The same thing can apply to uploading photos to a user's profile.
I never did replication and do not know much about it so I figured I would ask here if anyone knows or has done it before like this.
I have a user who wants me to enable replication on my server for his user. I dont like the sounds of it on a shared environment but if there is no risk to other users and its not a big resource hog I will do it. Anyway, from what I gather I have to:
1. execute: GRANT REPLICATION SLAVE ON user_main.* TO 'repl'@'ip-here' IDENTIFIED BY '4T6WjUZa'; [url]
2. Stop mysql server and Add in my.cnf: [mysqld] log-bin=mysql-bin server-id=1 slave-compressed=1 binlog-do-db=user_main start server[url]
3. execute: SHOW MASTER STATUS; we need values of colomns File and Position from output of above command[url]
So my questions are:
Is there any security risk? Is there significant extra resource usage? Is this even done on shared environments?
I have fairly a large web site that has a forum and a torrent tracker.
Currently MySQL server is handling about 150 queries an avarage per second. Here is the server spec:
Core2Duo 2.66Ghz 4Gb RAM 320GB SATA 7200RPM (Server provider does not have 1.5K RPM nor 1.0k RPM) 100Mbit Connection (servers on the same switch and the switch does not have 1Gbit port) MySQL Version: 5.0.51a
I had Master-Master Replication setup with forum running on one and the tracker running on the other. Although this has been working for about few days, we started seeing lags in the replication process. After a week, there is a major lag and the changes made on one of the servers takes about 5 hours to appear on the another. So, this doesn't work.
What would be the other ways of splitting MySQL queries concerning the same database?
While I was researching, I read about MySQL Cluster with database storage engine being NDB.
But, let's say that there is a power failure on both the nodes at the same time, then I would lose the whole database as the database is stored on the memory correct? I would not like to take that chance either, but if this is faster then replication method then maybe I will concider.
I thought about editing the forum coding to make all queries that concerns the tracker to go in to, say server B (with forum's primary MySQL server being Server A), and make the tracker use server B as MySQL backend, but it seemed like a heavy work so that will be the last choice.
We are currently configuring two machines to act as primary / secondary name servers.
Both machines are server 2003 Standard Editions, obviously based in seperate locations.
I would like to replicate all primary zones as secondary zones on the second server.
However If a machine dies I dont want to have to re-add every zone manually - I would rather point the machine at the other one and have it pull back information for all zones that machine is authorative for.
Is there a way to do this on server 2003 DNS or not?
What would be the best way to replicate two exchange servers across a WAN? I would like to run exchange but in two different physical locations for redundancy and backup purposes, to ensure if one goes down, the other is right there. Is there any good commercial solutions?
I'm trying to find a low cost solution for realtime file share replication in a windows environment.
It doesn't look like there are any open source windows cluster filesystems around, so the only viable option I found would be running OpenFiler in a replication cluster on Hyper-V nodes. Has anyone worked with this, does it work reliably?
The required IO throughput on these shares would really be minimal and my biggest concern is 100% availability.
Hello, we have a few web servers that run Windows 2003 Server and IIS for web page hosting. We develop custom applications and don't do "web hosting" per se.
What is the best way to do this in a load balanced environment? We have a Cisco load balancer out in front of these servers, but I'm curious about the following:
1) Is there a way to replicate IIS entries instead of having to configure the site on each server?
2) How does everyone handle file replication (hopefully in real time) across all servers?
I installed the MySQL binary packages in /usr/local/mysql/ after removing the MySQL RPM package. MySQL is functioning when I executed /usr/local/mysql/bin/safe_mysqld. I reinstalled MySQL before I installed PHP. When I used a PHP script to access a MySQL database, it outputs an error:
Code: Warning: mysqli::mysqli() [function.mysqli-mysqli]: (HY000/2002): can't connect to local mysql server through socket /var/lib/mysql/mysql.sock in index.php on line 2 However, I installed MySQL in /usr/local/mysql, not in /var/lib/mysql. How do I fix MySQL?
For some reason mysql wont start, i have tried restarting mysql but it wont, it says FAILED. The mysql.sock file seems to have disappeared and i cannot find it anywhere.
I recently had a harddrive failure and luckliy I can still access certain directories on this failed drive. I can still access the /var/lib/mysql/ directory which holds all the users databases and have backed all these up separately using tar.
Now what I need to know is how do you restore these database files to another server? I tried simply untar'ing one of these to the new servers /var/lib/mysql/ direcotry and it stuffed Mysql up - it went offline. I had to get a cpanel tech to bring Mysql back online.
how can I get these database files to fully work on a new server?
I've been racking my brains with this problem for the last couple of months and have made zero progress. I've asked a lot of people if they know what might be wrong here, but none of them have any idea.
Basically, the problem is that any sort of service monitor I put on my server shows MySQL as being down/offline, even when I know for sure it's up and running perfectly fine. All other services report a green light.
The mysqld service is running on port 3306, which is open both inbound and outbound on my APF config, so as far as I can tell it's nothing to do with the firewall (I won't rule that out though).
The other odd thing is that MySQL shows a green light within WHM, but not anywhere else.
Does anyone know what might be wrong here? Am I missing something entirely fundamental and obvious?
I've rented a dedicated server that comes with Red Hat Enterprise Linux 4 and MySQL 3.23 but I need at least MySQL 4.1 or higher. My knowledge about GNU/Linux is very limited, so I've read some documents at mysql.com and now I think I have to follow these steps:
1. Uninstall MySQL 3.23 with this command line: shell> rpm -e mysql-*.rpm
2. Install the server and client RPMs of MySQL 5.0: shell> rpm -i MySQL-server-VERSION.i386.rpm shell> rpm -i MySQL-client-VERSION.i386.rpm
I have a number of web sites on a dedicated server. Some of these web sites are a few years old. Are there any issues upgrading from MySQL 4.1 to 5.x? Are there web sites that may have compatibility issues?
I have recently upgraded mysql server from 5.0.75 to 5.1.31 on my Ubuntu server 9.04 32 bit. After that when I am running phpmyadmin it is printing a warning :
Your PHP MySQL library version 5.0.75 differs from your MySQL server version 5.1.31.
I'm trying to upgrade from MySQL 4 to MySQL 5 for performance reasons. MySQL 4 was working great so I decided to just go ahead and upgrade to MySQL 5 via CPanel. The upgrade appeared to go fine however I now get this error when trying to start MySQL.
/usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! mysql has failed, please contact the sysadmin (result was "Warning, no valid mysql.sock file found.mysql has failed").
I went ahead and did a forced re-install of MySQL 5, but that didn't help. Apache has been updated as well since then, but that did no good, and the MySQL process isn't starting at all.
I'd like to upgrade my current mysql 4.1 version to mysl 5, but i can't find a good tutorial or explenation! I've been searching for hours now without any good results. I've downloaded the lastest stable mysql 5 .rpm, and tried to install it with rpm -i mysql.version.rpm, but it says the following:
# rpm -i MySQL-server-standard-5.0.27-0.rhel4.i386.rpm warning: MySQL-server-standard-5.0.27-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5 error: Failed dependencies: MySQL conflicts with mysql-4.1.20-1.RHEL4.1.i386 MySQL-server conflicts with mysql-server-4.1.20-1.RHEL4.1.i386
I guess that means i have to uninstall mysql 4.1 first.
ok...
# rpm -e mysql-server-4.1.20-1.RHEL4.1.i386 warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave
Let's try to install it now.
# rpm -i MySQL-server-standard-5.0.27-0.rhel4.i386.rpm warning: MySQL-server-standard-5.0.27-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5 error: Failed dependencies: MySQL conflicts with mysql-4.1.20-1.RHEL4.1.i386
Ok, let's remove that.
# rpm -e mysql-4.1.20-1.RHEL4.1.i386 error: Failed dependencies: libmysqlclient.so.14 is needed by (installed) perl-DBD-MySQL-2.9004-3.1.i386 libmysqlclient.so.14 is needed by (installed) dovecot-0.99.11-4.EL4.i386 libmysqlclient.so.14 is needed by (installed) php-mysql-4.3.9-3.22.i386 libmysqlclient.so.14(libmysqlclient_14) is needed by (installed) dovecot-0.99.11-4.EL4.i386 libmysqlclient.so.14(libmysqlclient_14) is needed by (installed) php-mysql-4.3.9-3.22.i386 mysql = 4.1.20-1.RHEL4.1 is needed by (installed) mysql-devel-4.1.20-1.RHEL4.1.i386
Does upgrade work?
# rpm -Uvh MySQL-server-standard-5.0.27-0.rhel4.i386.rpm warning: MySQL-server-standard-5.0.27-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5 error: Failed dependencies: libmysqlclient.so.14 is needed by (installed) perl-DBD-MySQL-2.9004-3.1.i386 libmysqlclient.so.14 is needed by (installed) dovecot-0.99.11-4.EL4.i386 libmysqlclient.so.14 is needed by (installed) php-mysql-4.3.9-3.22.i386 libmysqlclient.so.14(libmysqlclient_14) is needed by (installed) dovecot-0.99.11-4.EL4.i386 libmysqlclient.so.14(libmysqlclient_14) is needed by (installed) php-mysql-4.3.9-3.22.i386
I have a big issue importing 4.0 databases with mysql 5.0.27.
I did a mysqldump -pxxxxx --force --all-databases > file.sql on server with mysql 4.0
But when I tried to import the file on server with mysql 5.0, this is what I got:
ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database' at line 1
I even tried to force import and I got: ERROR 1046 (3D000) at line x: No database selected for every database. I checked sql file and CREATE DATABASE xx and USE xx were both added.
I tried this with a single database and worked but with all not
loading a phpinfo() shows that the mysql variable "Client API version" on my server doesn't match the version of mysql installed ( 4.0.20 when mysql version is 4.1.21).
Can this cause trouble and php or mysql errors on scripts i'm running?