配置OGG到MYSQL复制时登陆MYSQL报错解决

1.MYSQL登陆报错
[oracle@bys2 mysqlogg]$ mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

此时使用 mysql -u root   即不使用密码可以登陆。

重改密码:使用root用户操作
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;    ---刷新数据库中数据。
mysql> quit
# /etc/init.d/mysqld restart
此时就可以使用密码登陆了。
# mysql -u root -p
Enter password:
mysql>

2.OGG中登陆MYSQL报错解决
GGSCI (bys2.oel.com) 2> dblogin sourcedb oggtest,userid root
Password:
2013-08-30 12:03:14 WARNING OGG-00769  MySQL Login failed: . SQL error (2002). Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
ERROR: Failed to connect to MySQL database engine for HOST localhost, DATABASE , USER root, PORT 3306.


GGSCI (bys2.oel.com) 3> exit
[oracle@bys2 mysqlogg]$ su -
Password:
[root@bys2 ~]# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
[root@bys2 ~]# exit
logout
[oracle@bys2 mysqlogg]$ ./ggsci
Oracle GoldenGate Command Interpreter for MySQL
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230
Linux, x86, 32bit (optimized), MySQL Enterprise on Apr 23 2012 04:29:30
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (bys2.oel.com) 1> dblogin sourcedb oggtest,userid root
Password:
Successfully logged into database.

你可能感兴趣的:(ORACLE,故障排查)