How can we split the name string into two parts by using MySQL SUBSTRING_INDEX() function?

Fendadis John
Published on 20-Feb-2018 17:33:04
To make it understand, we are using the following data from a table named ‘customerdetail’.mysql> Select * from Customerdetail; +----------------------+----------------------+-----------+---------------------+ | Name                 | FName                | Address   | Emailid             ... Read More

How MySQL prevents unauthorized clients from accessing the database system?

Abhinaya
Published on 20-Feb-2018 17:29:07
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 ... Read More

How can we split an IP Address into four respective octets by using MySQL SUBSTRING_INDEX() function?

Chandu yadav
Published on 20-Feb-2018 17:28:57
Suppose we have a table named ‘ipaddress’ which contains the IP addresses as its values in column ‘IP’ as follows −mysql> Select * from ipaddress; +-----------------+ | ip              | +-----------------+ | 192.128.0.5     | | 255.255.255.255 | | 192.0.255.255   | | 192.0.1.5 ... Read More

How can we change MySQL user password by using the ALTER USER statement?

mkotla
Published on 20-Feb-2018 17:26:09
We can also use ALTER USER statement along with IDENTIFIED BY clause to change MySQL user password. Its syntax would be as possible −SyntaxALTER USER user_name@host_name IDENTIFIED BY ‘new_password’Here,  New_password would be new password we want to set for MySQL userUser_name is the name of a current user.Host_name is the ... Read More

How can I use SUBSTRING_INDEX() function to get the substring as output which is between two same delimiters in a string?

Samual Sam
Published on 20-Feb-2018 17:26:09
We need to use nested SUBSTRING_INDEX() function for getting the substring as output which is between two same delimiters in a string. For example, from the string ‘www.tutorialspoint.com’, we want the substring ‘tutorialspoint’, which is in between two same delimiters ‘.’ as output then SUBSTRING_INDEX() function can be used in ... Read More

How can we change MySQL user password by using the SET PASSWORD statement?

Govinda Sai
Published on 20-Feb-2018 17:25:25
We can use SET PASSWORD statement to change the password. Before using this command, we need to have at least UPDATE privileges. Its syntax would be as follows −SyntaxSET PASSWORD FOR ‘user_name@host_name’=new_password;Here, New_password would be new password we want to set for MySQL userUser_name is the name of the current ... Read More

What is the use of FLUSH PRIVILEGES statement in MySQL?

Vrundesha Joshi
Published on 20-Feb-2018 17:03:34
Actually, we need to perform flush-privileges operation to tell the server to reload the grant tables. This can be done by issuing FLUSH PRIVILEGES statement or by executing a mysqladmin flush-privileges or mysqladmin reload command. FLUSH PRIVILEGES is really needed if we modify the grant tables directly using such as ... Read More

How can we change MySQL user password by using UPDATE statement?

Giri Raju
Published on 20-Feb-2018 17:02:29
To change MySQL user password with the help of UPDATE statement, we need to update the ‘user’ table of the ‘mysql’ database. Its syntax would be as follows −SyntaxUSE mysql; UPDATE user SET authentication_string = PASSWORD(‘new_password’) WHERE user = user_name AND host = host_name;The first two statements will be common ... Read More

How can we get the list of tables in a particular database from MySQL Server command line?

Rishi Rathor
Published on 20-Feb-2018 17:02:08
We need to use ‘mysqlshow’ client program along with the name of the database to get the list of tables in a particular database. Its syntax would be as follows −Mysqlshow – u root db_name [pat_matching]Here db_name would be the name of the database from which we want to get ... Read More

How can we analyze the tables of a particular database from MySQL Server command line?

Ramu Prasad
Published on 20-Feb-2018 17:05:44
We need to use ‘mysqlcheck’ client program along with –analyze option to analyze the tables of a particular database. Its syntax would be as follows −Mysqlcheck – u root –analyze db_nameExampleThe following command will analyze the tables of database ‘query’ −C:\mysql\bin>mysqlcheck -u root --analyze query query.cars           ... Read More
Advertisements