1

I am trying to create a SQL user on Server A so the Server B can access SQL server of Server A using IPv6 but for some reason I am getting syntax error while running create user command.

The Query I am trying to run:

MariaDB [(none)]> CREATE USER ‘dbusr2’@‘2600:3c00::f03c:91ff:fe24:8266’ IDENTIFIED BY ‘sd6@fs54sd4d’;

Getting syntax error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual thatc00::f03c:91ff:fe24:8266’ IDENTIFIED BY ‘sd6@fs54sd4d’' at line 1 use near ':3c

Output of ip -6 addr show on Server B

root@debian:~# ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 2600:3c00::f03c:91ff:fe24:8266/64 scope global mngtmpaddr dynamic 
       valid_lft 2591996sec preferred_lft 604796sec
    inet6 fe80::f03c:91ff:fe24:8266/64 scope link 
       valid_lft forever preferred_lft forever
root@debian:~# 

Since I am very new to IPv6 am I missing something here?

Kevin S
  • 13
  • 2
  • There has been issues with MySQL IPv6 support, so you need to check your MySQL version and see if newer versions fix IPv6 issues. – Tero Kilkanen Feb 05 '17 at 18:24

1 Answers1

1

I think the problem you are seeing is caused by the 'magic quotes' you are using, this seems to work

CREATE USER 'dbusr2'@'2600:3c00::f03c:91ff:fe24:8266' IDENTIFIED BY 'sd6@fs54sd4d';

Note that this uses standard single quotes.

user9517
  • 115,471
  • 20
  • 215
  • 297