Mysql Master-Slave Replication Grant privileges to salve error - mysql

sql:
GRANT REPLICATION SLAVE ON *.* TO root#'172.17.0.5' IDENTIFIED BY PASSWORD 'root123';
Error Info:
[42000][1064] You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near 'IDENTIFIED BY PASSWORD 'root123'' at line 1

I thik it's helpful for you.
GRANT REPLICATION SLAVE ON *.* TO 'root'#'172.17.0.5' IDENTIFIED BY 'root123';

Related

How to grant all mysql 8.0 privileges to debezium in windows

I tried the below command
mysql> GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE,
REPLICATION CLIENT ON *.* TO 'debezium' IDENTIFIED BY 'dbz';
It gave the following error
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY 'dbz'' at line 1
To grant all privileges use GRANT ALL
GRANT ALL ON *.* TO 'debezium'#'%' IDENTIFIED BY 'dbz';
You are missing the host in your query I added % you can log in from anywhere, change it based on your needs.

MySQL ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

When I tried to grant privileges on users at mySQL, the error happened.Am I type something wrong on the command line?
mySQL Ver 8.0.16 for macos10.14 on x86_64 (MySQL Community Server - GPL).
mysql>grant all privileges on librarydb.* to 'phill'#'%' identified by '123456';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use near
'identified by '123456'' at line 1.
The next command
mysql>grant all privileges on librarydb.* to 'phill'#'%' identified by '123456';
Should be changed to:
mysql> create user 'phill' identified by '123456';
mysql> grant all privileges on librarydb.* to 'phill';
if the 'phill' user have not been created yet. If it have been created earlier, then use alter instead of create
What version is your MySQL? If it's 5.7 or later, maybe same as this question:
Unsuccessfully granting privileges

Host 'XXX' is not allowed to connect to this MySQL server (V.8)

When trying to connect to MySQL running on a local network I'm getting the error message:
Host 'XXX' is not allowed to connect to this MySQL server.
Disclaimer (MySQL Ver 8)
The answers provided bellow do not solve te problem in MySQL v8
Host 'xxx.xx.xxx.xxx' is not allowed to connect to this MySQL server
host 'localhost' is not allowed to connect to this MySQL server (#1130)
The solution provided in these old answers are returning the following error in MySQL Ver 8.0.13.
GRANT ALL PRIVILEGES ON mysql.* TO root#localhost IDENTIFIED BY 'pass123' WITH GRANT OPTION;
Or
Grant All Privileges ON *.* to 'root'#'%' Identified By 'pass123';
Output message:
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'IDENTIFIED BY 'pass123' WITH GRANT OPTION' at line
1
See https://dev.mysql.com/doc/refman/8.0/en/grant.html
The GRANT syntax has changed in V8, you no longer need or are allowed the IDENTIFIED .. part.
CREATE USER 'fred'#'localhost' IDENTIFIED BY 'password';
GRANT All ON db.* to 'fred'#'%';
Or for anywhere on your local lan segment maybe something like this
GRANT All ON db.* to 'fred'#'10.0.0';

Grant all syntax for mysql on Server version: 8.0.11 MySQL

What's wrong with it
grant all privileges on apip.* to 'root'#'%' IDENTIFIED BY PASSWORD 'rootadmin';
it gives the following error
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY PASSWORD 'rootadmin'' at line 1
IDENTIFIED BY are keywords accepted by the CREATE USER command, not the GRANT command.

Grant All Syntax

This isn't working:
use mysql
GRANT ALL ON *.* TO 'root'#'192.168.1.2'
Nor is
use mysql
GRANT ALL ON *.* TO 'root'#'192.168.1.2' IDENTIFIED BY 'password'
This is the error I'm getting:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GRANT ALL ON *.* TO 'root'#'192.168.1.2'' at line 3
I'm on server version 5.5.8. What's wrong?
Try this:
use mysql
GRANT ALL ON *.* TO 'root#192.168.1.2' IDENTIFIED BY 'password'