Grant All Syntax - mysql

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'

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.

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL serrver for mySQL [duplicate]

i have installed mysql 8.0.12 into one linux node and when i try to give below grant permission to get access from other nodes, i am getting 42000 error
command issued :
GRANT ALL PRIVILEGES ON *.* TO 'root'#'%' IDENTIFIED BY 'password';
Return results:
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 'secure1t'' at line 1
Any help would be appreciated.
You don't use IDENTIFIED BY in GRANT queries, it's used in CREATE USER.
CREATE USER 'root'#'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'root'#'%';
GRANT command reference
CREATE USER command reference
GRANT ALL PRIVILEGES ON your_desired_database_name.* TO 'root'#'localhost';
then
FLUSH PRIVILEGES;
**This worked for me and will work for you
**

mysql ERROR 1064 (42000): You have an error in your SQL syntax;

i have installed mysql 8.0.12 into one linux node and when i try to give below grant permission to get access from other nodes, i am getting 42000 error
command issued :
GRANT ALL PRIVILEGES ON *.* TO 'root'#'%' IDENTIFIED BY 'password';
Return results:
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 'secure1t'' at line 1
Any help would be appreciated.
You don't use IDENTIFIED BY in GRANT queries, it's used in CREATE USER.
CREATE USER 'root'#'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'root'#'%';
GRANT command reference
CREATE USER command reference
GRANT ALL PRIVILEGES ON your_desired_database_name.* TO 'root'#'localhost';
then
FLUSH PRIVILEGES;
**This worked for me and will work for you
**

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.

Mysql Master-Slave Replication Grant privileges to salve error

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';