Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot log in to mysql DB by ghost user #1416

Open
PaulChen79 opened this issue May 10, 2024 · 1 comment
Open

Cannot log in to mysql DB by ghost user #1416

PaulChen79 opened this issue May 10, 2024 · 1 comment

Comments

@PaulChen79
Copy link

I'm using gh-ost on my local environment to test if my migration is work.

My master-slave setting is

127.0.0.1:3307 -> master by docker image
127.0.0.1:3308 -> slave by docker image

I've created an user 'ghost'@'%' on master and logging in by this account is tested by command line below:

mysql -h 127.0.0.1 --port=3307 -ughost -p # for master works!
mysql -h 127.0.0.1 --port=3308 -ughost -p # for slave works!

Now when I execute this command

gh-ost \
--user="ghost" \
--password="ghost" \
--host="127.0.0.1" \
--serve-tcp-port=3307 \
--max-load=Threads_running=100 \
--critical-load=Threads_running=1000 \
--chunk-size=2000 \
--throttle-control-replicas="127.0.0.1:3308" \
--replica-server-id='2' \
--max-lag-millis=1000 \
--nice-ratio=12 \
--allow-on-master \
--database="test-db" \
--table="test_table" \
--verbose \
--alter="ADD action_item_id int(10) unsigned NOT NULL DEFAULT 0" \
--switch-to-rbr \
--allow-master-master \
--cut-over=default \
--exact-rowcount \
--concurrent-rowcount \
--default-retries=120 \
--panic-flag-file=/<path>/ghost-file/co_ghost.panic.flag \
--throttle-flag-file=/<path>/ghost-file/co_ghost.throttle.flag \
--postpone-cut-over-flag-file=/<path>/ghost-file/co_ghost.postpone.flag \
--execute

I encounter this error:

2024-05-10 14:39:55 INFO starting gh-ost 1.1.6
2024-05-10 14:39:55 INFO Migrating `test-db`.`test_table`
2024-05-10 14:39:55 INFO Tearing down inspector
2024-05-10 14:39:55 FATAL Error 1045: Access denied for user 'ghost'@'localhost' (using password: YES)

I don't know how to resolve this issue because currently, I believe my host and port settings are correct. Or are my settings incorrect?

Thank you! 🙏

@meiji163
Copy link
Contributor

meiji163 commented Nov 7, 2024

--serve-tcp-port=3307 tells gh-ost start a TCP server on port 3307, which is already in use by MySQL. Perhaps this is the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants