- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 4378 Articles for MySQL
![Alankritha Ammu](https://www.tutorialspoint.com/assets/profiles/13523/profile/60_83090-1512649277.jpg)
95 Views
MySQL returns NULL if we provide any non-hexadecimal number as an argument to UNHEX() function. Following example will demonstrate it.Examplemysql> Select UNHEX('ANK96598'); +-------------------+ | UNHEX('ANK96598') | +-------------------+ | NULL | +-------------------+ 1 row in set (0.00 sec)As we know that the valid hexadecimal digits are between ‘0…9’, ‘A…F’ or ‘a…f’ hence the above query returns NULL.
![Akshaya Akki](https://www.tutorialspoint.com/assets/profiles/13526/profile/60_48621-1512703980.jpg)
1K+ Views
MySQL TRIM() function is used to remove all the suffixes or prefixes or both from the string. The working of TRIM() function can be understood with the help of its syntax −SyntaxTRIM([{BOTH | LEADING | TRAILING} [str_to_remove] FROM] string)Here, the argument BOTH means the prefixes from both left and right to be removed from the string.LEADING argument means that only leading prefixes to be removed.TRAILING argument means that only trailing prefixes to be removed.Str_to_remove is the argument which means the string we want to remove from the string.String argument means the string from which the prefixes have to be removed.Examplemysql> ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
131 Views
The syntax of SUBSTRING() function using FROM and FOR keywords is the standard MySQL syntax.SyntaxSUBSTRING(str FROM pos FOR len)Here, str is the string from which substring would be returned.Pos is the starting position of substring.Len is the length of substring i.e. the total number of characters fetched from str.Examplemysql> Select SUBSTRING('foobarbar' FROM 4 FOR 5); +-------------------------------------+ | SUBSTRING('foobarbar' FROM 4 FOR 5) | +-------------------------------------+ | barba | +-------------------------------------+ 1 row in set (0.00 sec)The result set above, makes the use of FROM and FOR keywords very much clear in SUBSTRING() function.
![seetha](https://www.tutorialspoint.com/assets/profiles/13549/profile/60_42938-1512640859.jpg)
232 Views
If we omit the hostname part of the user account, MySQL will accept it and allow the user to connect from any host. Its syntax would be as follows −Use mysql; CREATE USER user_name IDENTIFIED BY password;Here, user_name is the name of the user we wish to take account of.Password is the password we wish to make for user_account. With the help of this password, MySQL server will identify this user.ExampleIn the given example we are creating a user ‘REMOTE’ by omitting the host name.mysql> CREATE USER remote identified by 'password123'; Query OK, 0 rows affected (0.00 sec)The user ‘Remote’ can ... Read More
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
201 Views
To make it understand, we are using the following data from a table named ‘customerdetail’.mysql> Select * from Customerdetail; +----------------------+----------------------+----------+---------------------+ | Name | FName | Address | Emailid | +----------------------+----------------------+----------+---------------------+ | Advik Jhamb | Lovkesh Jhamb | Mumbai | Advik@gmail.com | | Chirag Jai Patil | Raman Jai Patil | Gujrat | chirahp@yahoo.com | | Devansh Singh Rajput | Kishore Singh Rajput | ... Read More
![vanithasree](https://www.tutorialspoint.com/assets/profiles/13547/profile/60_85216-1512542720.jpg)
2K+ Views
It is quite possible to allow a user account to connect from any host. To do so we need to create the user with the help of ‘%’ wild card character after @ character. Its syntax would be as follows −Use mysql; CREATE USER user_name@’%’ IDENTIFIED BY password;Here user_name is the name of the user we wish to make an account for.Password is the password we wish to make for user_account. With the help of this password, MySQL server will identify this user.ExampleIn the given example we are creating a user ‘Gaurav’ by using ‘%’ character so that it can be ... Read More
![Ankitha Reddy](https://www.tutorialspoint.com/assets/profiles/13550/profile/60_73963-1512711511.jpg)
227 Views
As we know that, MySQL database server is having the user table in MySQL database which is used to store the user accounts so by using MySQL database we can create user accounts in MySQL database server. There must be two things while creating the new user account, one is the username and other is the hostname which is after @ character. The syntax for creating the user account is as follows − Syntax Use mysql; CREATE USER user_account IDENTIFIED BY password; Here user_account is the name of the user we wish to take account of. It can ... Read More
![radhakrishna](https://www.tutorialspoint.com/assets/profiles/13544/profile/60_40618-1512640354.jpg)
162 Views
When we install MySQL server, a database named MySQL created automatically. This MySQL database contains five main grant tables with the help of which MySQL server can control the privileges of MySQL database server. These tables are as follows −user tableThis table contains user account and global privileges columns. MySQL uses the user table to either accept or reject a connection from a host. A privilege granted in the user table is effective to all databases on the MySQL server.db tableThis table contains database-level privileges. MySQL uses the db table to determine which database a user can access and from which host. ... Read More
![Fendadis John](https://www.tutorialspoint.com/assets/profiles/13534/profile/60_64028-1512539837.jpg)
189 Views
To make it understand, we are using the following data from a table named ‘customerdetail’.mysql> Select * from Customerdetail; +----------------------+----------------------+-----------+---------------------+ | Name | FName | Address | Emailid | +----------------------+----------------------+-----------+---------------------+ | Advik Jhamb | Lovkesh Jhamb | Mumbai | Advik@gmail.com | | Chirag Jai Patil | Raman Jai Patil | Gujrat | chirahp@yahoo.com | | Devansh Singh Rajput | Kishore Singh Rajput ... Read More
![Abhinaya](https://www.tutorialspoint.com/assets/profiles/13548/profile/60_54851-1512705920.jpg)
185 Views
MySQL implements a sophisticated access control and privilege system that allows us to create comprehensive access rules for handling client operations and effectively preventing unauthorized clients from accessing the database system.The MySQL access control has two stages when a client connects to the server −Connection verification A client, which connects to the MySQL database server, needs to have a valid username and password. In addition, the host from that the client connects needs to match with the host within the MySQL grant table.Request verificationonce a connection is established successfully, for each statement issued by the client, MySQL checks whether the client ... Read More