
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set Special Characters for Password in MySQL User Creation
To set special characters for a password, use the following syntax −
create user 'yourUserName'@'yourHostName' identified by 'yourSpecialCharacterPassword';
Let us implement the above syntax in order to create a new user and set password with special characters −
mysql> create user 'Mike'@'localhost' identified by 'Mike_123456'; Query OK, 0 rows affected (0.35 sec)
Let us check the table where MySQL user and host is stored −
mysql> select user,host from MySQL.user;
This will produce the following output. The new user created successfully −
+------------------+-----------+ | user | host | +------------------+-----------+ | Bob | % | | Charlie | % | | Robert | % | | User2 | % | | mysql.infoschema | % | | mysql.session | % | | mysql.sys | % | | root | % | | @UserName@ | localhost | | Adam Smith | localhost | | Chris | localhost | | David | localhost | | James | localhost | | John | localhost | | John Doe | localhost | | Mike | localhost | | User1 | localhost | | am | localhost | | hbstudent | localhost | | mysql.infoschema | localhost | | mysql.session | localhost | +------------------+-----------+ 21 rows in set (0.00 sec)
Advertisements