配置OGG到MYSQL複製時登陸MYSQL報錯解決

還不算暈發表於2013-10-28
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.

相關文章