Search code examples
mysqlsqlcmdmariadb

How set mysql database creata password with consisting of ==> '


I want to make new user with password ==> d'0g=<<[enU^HXpt

But I get sintax error because 'd' <== this part in password

MYSQL command look like this:

CREATE USER 'student'@'example.com' IDENTIFIED BY 'd'0g=<<[enU^HXpt'

how I can select this password without sintax error? (d'0g=<<[enU^HXpt)

  • summary: How I can make password what include => (') this.

Solution

  • Type it in as \'. This is called escaping and you can read about it here: https://mariadb.com/kb/en/string-literals/