Unix Technical Forum

master/slave replication - errors!!

This is a discussion on master/slave replication - errors!! within the MySQL General forum forums, part of the MySQL category; --> hi.. doing a simple test of master/slave replication, using mysql. i have two test systems: master - foo (192.168.10.13) ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 07:02 AM
bruce
 
Posts: n/a
Default master/slave replication - errors!!

hi..

doing a simple test of master/slave replication, using mysql.

i have two test systems:
master - foo (192.168.10.13)
slave - cat (192.168.20.20)

on both machines, i created a testmasterdb. on the master, i populated the
tbl within the db with some test data. there are no tbls in the slave, only
the "create database..."

for the master, the my.cnf is:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

log-bin=/var/log/mysql/mysql-bin.log
binlog-do-db=testmasterdb
server-id=11

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


for the slave, the my.cnf is:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

#replication - slave server
server_id=2
master_host=mfgtest3.stratalight.com
master_user=slave
master_password=slave
master_connect_retry=60
replicate-do-db=testmasterdb

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
--------------------------------------------------------

on the master, (logged in as root) i granted replication privileges to my
test user (slave/slave).

on the slave mysql, i then tried to do a
load data from master

and got the following error:
"Error running query on master: Access denied;
you need the RELOAD privilege for this operation"

do i need to run the "load data" cmd from the slave, when i'm logged in as
user "slave", i would think that being root would allow me to issue the cmd?
do i have to have the physical ipaddress or the master in the my.cnf file?
(i would think i could have the fqdn, given that ips change -dhcp)

any thoughts/ideas/comments...

thanks






Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 07:02 AM
Baron Schwartz
 
Posts: n/a
Default Re: master/slave replication - errors!!

bruce wrote:
> hi..
>
> doing a simple test of master/slave replication, using mysql.
>
> i have two test systems:
> master - foo (192.168.10.13)
> slave - cat (192.168.20.20)
>
> on both machines, i created a testmasterdb. on the master, i populated the
> tbl within the db with some test data. there are no tbls in the slave, only
> the "create database..."
>
> for the master, the my.cnf is:
> [mysqld]
> datadir=/var/lib/mysql
> socket=/var/lib/mysql/mysql.sock
> # Default to using old password format for compatibility with mysql 3.x
> # clients (those using the mysqlclient10 compatibility package).
> old_passwords=1
>
> log-bin=/var/log/mysql/mysql-bin.log
> binlog-do-db=testmasterdb
> server-id=11
>
> [mysql.server]
> user=mysql
> basedir=/var/lib
>
> [mysqld_safe]
> log-error=/var/log/mysqld.log
> pid-file=/var/run/mysqld/mysqld.pid
>
>
> for the slave, the my.cnf is:
> [mysqld]
> datadir=/var/lib/mysql
> socket=/var/lib/mysql/mysql.sock
> # Default to using old password format for compatibility with mysql 3.x
> # clients (those using the mysqlclient10 compatibility package).
> old_passwords=1
>
> #replication - slave server
> server_id=2
> master_host=mfgtest3.stratalight.com
> master_user=slave
> master_password=slave
> master_connect_retry=60
> replicate-do-db=testmasterdb


Use CHANGE MASTER TO instead. It avoids a lot of potential problems.
Settings in the my.cnf is deprecated.

>
> [mysql.server]
> user=mysql
> basedir=/var/lib
>
> [mysqld_safe]
> log-error=/var/log/mysqld.log
> pid-file=/var/run/mysqld/mysqld.pid
> --------------------------------------------------------
>
> on the master, (logged in as root) i granted replication privileges to my
> test user (slave/slave).
>
> on the slave mysql, i then tried to do a
> load data from master
>


Don't use LOAD DATA FROM MASTER either. It only ever worked for certain
cases and is also deprecated. You should do a dump-and-load or file
copy to initialize the slave.

> and got the following error:
> "Error running query on master: Access denied;
> you need the RELOAD privilege for this operation"
>
> do i need to run the "load data" cmd from the slave, when i'm logged in as
> user "slave", i would think that being root would allow me to issue the cmd?
> do i have to have the physical ipaddress or the master in the my.cnf file?
> (i would think i could have the fqdn, given that ips change -dhcp)


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:29 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com