473,624 Members | 2,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Slave can't connect to master (replication, 4.0.23a)

Hello!

I'm trying to set up replication between two servers and even though I
did everything according to the documentation, the slave keeps failing
to connect to the master like this:

| 050119 0:23:43 Slave SQL thread initialized, starting replication in
| log 'zwart-bin.001' at position 79, relay log './blauw-relay-bin.001'
| position: 4
| 050119 0:23:43 Slave I/O thread: error connecting to master
| 'r***@xxx.xxx.x xx.yyy:3306': Error: 'Access denied for user:
| 'r***@xxx.xxx.x xx.xxx' (Using password: YES)' errno: 1045
| retry-time: 60 retries: 86400

But when I try to connect with mysql-client myself, using the same host,
same user and same password, I get in correctly.

On master everything is looking cool:
| mysql> select version()\G
| version(): 4.0.23a-log
| mysql> show grants for repl\G
| Grants for repl@%: GRANT SELECT, RELOAD, PROCESS, FILE, SUPER,
| REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'repl'@'%' IDENTIFIED BY
| PASSWORD 'xxxxxxxxxxxxxx xx'
| mysql> show master status\G
| File: zwart-bin.001
| Position: 177
| Binlog_do_db: this,that,here, there
| Binlog_ignore_d b:
| shell> cat /etc/my.cnf
| [mysqld]
| log-bin
| binlog-do-db = mysql
| binlog-do-db = beheer
| binlog-do-db = v
| binlog-do-db = products
| server-id = 1

On slave everything looks cool too:
| mysql> select version()\G
| version(): 4.0.23a
| shell> cat /etc/my.cnf
| [mysqld]
| server-id = 2
| master-host = xxx.xxx.xxx.xxx
| master-port = 3306
| master-user = repl
| master-password = xxxxxxx
| replicate-do-db = this
| replicate-do-db = that
| replicate-do-db = here
| replicate-do-db = there
| log-warnings
| mysql> show slave status\G
| Master_Host: xxx.xxx.xxx.xxx
| Master_User: repl
| Master_Port: 3306
| Connect_retry: 60
| Master_Log_File : zwart-bin.001
| Read_Master_Log _Pos: 79
| Relay_Log_File: blauw-relay-bin.001
| Relay_Log_Pos: 4
| Relay_Master_Lo g_File: zwart-bin.001
| Slave_IO_Runnin g: Yes
| Slave_SQL_Runni ng: Yes
| Replicate_do_db : this,that,here, there
| Replicate_ignor e_db:
| Last_errno: 0
| Last_error:
| Skip_counter: 0
| Exec_master_log _pos: 79
| Relay_log_space : 4

It says 'Slave_(IO|SQL) _Running: Yes' even though it's not according to
the processlist of master which shows no remote users doing binlog
dumps...

I have done everything according to the books. The GRANT originally was
'GRANT REPLICATION SLAVE ON *.* TO ...' but during my tries to fix this
I tried other grants with the privileges shown above... I locked the
tables, copied everything, recorded the position, etc, etc...

The weirdest thing for me is that I can login doing:

| shell> mysql -u repl -h xxx.xxx.xxx.xxx -p
| Password:
| mysql>

But the mysql slave server can't on its self?

Both mysqld's are linked against the same version of libraries, both are
4.0.23a, running on FreeBSD 4.10 x86 platform.

Can anybody tell me what is missing?

Thanks,
Sander.
--
Hey.. I'm done talkin'. Now check out my pretty!
Jul 23 '05 #1
3 18965
On Tue, 18 Jan 2005 23:23:23 +0000 (UTC), Sander Smeenk
<ss*****@freshd ot.not> wrote:
Hello!

I'm trying to set up replication between two servers and even though I
did everything according to the documentation, the slave keeps failing
to connect to the master like this:

| 050119 0:23:43 Slave SQL thread initialized, starting replication in
| log 'zwart-bin.001' at position 79, relay log './blauw-relay-bin.001'
| position: 4
| 050119 0:23:43 Slave I/O thread: error connecting to master
| 'r***@xxx.xxx.x xx.yyy:3306': Error: 'Access denied for user:
| 'r***@xxx.xxx.x xx.xxx' (Using password: YES)' errno: 1045
| retry-time: 60 retries: 86400
cut

The weirdest thing for me is that I can login doing:

| shell> mysql -u repl -h xxx.xxx.xxx.xxx -p
| Password:
| mysql>
Are you trying to log in from the slave box with this command? Just to
be sure. ;-) Have you tried logging in by this command with the
replication host and user specified like so:

mysql -u re**@xxx.xxx.xx x.yyy -h xxx.xxx.xxx.xxx -p

Because I think that when you log in manually the hostname is not
specified and may be repl@localhost instead of re**@xxx.xxx.xx x.yyy.

I've set up replication on two boxes rather succesfully. Haven't had
these weird problems. I only used the permissions stated in the
manual.

But the mysql slave server can't on its self?

Both mysqld's are linked against the same version of libraries, both are
4.0.23a, running on FreeBSD 4.10 x86 platform.
Didn't you forget to flush the privileges on the master? What is the
result you get when you log in as root user on the mysql master server
and issue the following command:

select * from mysql.user where user='replicati on'\G

It should show you the details of your replication user. Don't worry
about the password it can not be decripted.Can anybody tell me what is missing?

Thanks,
Sander.


Jonathan
Jul 23 '05 #2
According to Sander Smeenk <ss*****@freshd ot.not>:

Following up on my own post :)
| master-host = xxx.xxx.xxx.xxx
| Master_Host: xxx.xxx.xxx.xxx


This is quite odd...

Turns out that for some odd reason it won't work when I specify
master_host as an IP-address, but it WILL work when I put the hostname
in.

Anyone got an explanation for this?

It's not resolvers, because then it *SHOULD* work with IP addresses and
*NOT* with hostnames, right?

Anyways, it's replicating as we speak!

Sander.
--
Hey.. I'm done talkin'. Now check out my pretty!
Jul 23 '05 #3
On Wed, 19 Jan 2005 08:50:22 +0000 (UTC), Sander Smeenk
<j0*****@freshd ot.not> wrote:
According to Sander Smeenk <ss*****@freshd ot.not>:

Following up on my own post :)
| master-host = xxx.xxx.xxx.xxx
| Master_Host: xxx.xxx.xxx.xxx
This is quite odd...

Turns out that for some odd reason it won't work when I specify
master_host as an IP-address, but it WILL work when I put the hostname
in.

Anyone got an explanation for this?

It's not resolvers, because then it *SHOULD* work with IP addresses and
*NOT* with hostnames, right?


Because hostnames are static for every pc unless you specifically
change them. IP numbers can be assigned dynamically. The following can
occur in case your network assigns the IP address dynamically.

If a new IP address is assigned to your box you cannot log in to the
MySQL server anymore and if this old IP number is assigned to another
PC that PC is allowed to log in. It could be that the computer that is
allowed to log in now is used by someone which you don't even want to
specify access to on the MySQL server.

Therefore use hostnames instead of IP numbers
Anyways, it's replicating as we speak!

Sander.


Jonathan
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
931
by: Jordy | last post by:
Environment: Sun servers running solaris 2.8 Php 4.3.6 Apache 1.3.29 Mysql 4.1.1 phpMyAdmin 2.6.0-alpha1 phpAds 2.0 PhpMyadmin and phpAds don't succeed to connect the MySql database when
0
9005
by: Ryan Stewart | last post by:
I'm running MySQL server on a WinXP box at home. I have a cable modem/router. I've set up port forwarding on port 3306 to the machine running MySQL. I can connect locally just fine, but when I try to connect from a remote location using: mysql -h xxx.xxx.xxx.xxx -P 3306 -u root -p mysql I get: ERROR 2003: Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10061) When I try:
3
17794
by: Pugi! | last post by:
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get the following problem when connecting to mysql through a browser (phpMyAdmin): : #2002 Can't connect to local MySQL server through socket /var/lib/mysql/mysql.sock On the website of MySQL this error is mentioned but I found no solution. In /var/log/messages the following log occurs :
1
121524
by: jiing | last post by:
Now let me describe what I have done and my purpose: Originally, I want to user ports to install phpBB But I found that phpBB doesn't support mysql 5.x (but the ports installed mySQL 5.0.0 alpha) so I deinstall mysql5-server and mysql5-client And then I install mysql41-server and mysql41-client on FreeBSD 5.3 by ports but now , mysql is not workable
1
1752
by: Kurt | last post by:
For some reason I cannot use an append query to append records to a design master replication table that has the index key on a random Long Integer. I checked all the text fields in the Master Replication table to make sure the properties are appropriately set as Required: No and Allow Zero Length: Yes. Also no violation of unique indexes. The Access error message says can't append all the records, ....didn't add 1576 records to the...
2
2736
by: xiuchuanli | last post by:
I install Fedora 4 with web server, after that I installed mysql 5.0.15. Now I can connect to mysql from command line and mysql-administrator and mysql-query-browser. But when I try to test to connect from php code, it told me that "can not connect to local mysql through /tmp/mysql.sock. /tmp/mysql.sock is my sock file to connect and permission is set good. when I add phpinfo() to my php code, it show me that mysql lib php uses is 4.1.X,...
0
1815
by: xiuchuanli | last post by:
I install Fedora 4 with web server, after that I installed mysql 5.0.15. Now I can connect to mysql from command line and mysql-administrator and mysql-query-browser. But when I try to test to connect from php code, it told me that "can not connect to local mysql through /tmp/mysql.sock. /tmp/mysql.sock is my sock file to connect and permission is set good. when I add phpinfo() to my php code, it show me that mysql lib php uses is 4.1.X,...
0
2752
by: Clodoaldo Pinto | last post by:
Can't connect to postgresql server php error log message: PHP Warning: pg_connect() : Unable to connect to PostgreSQL server: could not connect to server: Permission denied\n\tIs the server running on host &quot;127.0.0.1&quot; and accepting\n\tTCP/IP connections on port 5432? php connection string:
4
3760
by: d3vkit | last post by:
Okay so I am at a loss here. I have a website that I've previously had no trouble connecting to the mysql DB on. I have an include to a connect file with the relevant connection info, and it was working fine until today. I am trying to implement some ajax with the javascript framework mootools (although I don't see how this is causing the problem it started happening right around this time sooo...) I am sending info from my login form to the...
0
8234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8172
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4079
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.