Found 4219 Articles for MySQLi

How can I shutdown MySQL Server?

Daniol Thomas
Updated on 20-Jun-2020 11:18:42

378 Views

With the help of ‘mysqladmin’ program we would be able to shutdown our MySQL server. It can be used as follows on command line −C:\mysql\bin>mysqladmin -u root shutdownWe will see nothing after entering the above command because it will not print any message in command window. We should have to trust that MySQL server has been shutdown properly.

How can I check the version of MySQL Server?

Priya Pallavi
Updated on 20-Jun-2020 11:19:18

378 Views

With the help of ‘mysqladmin’ program we would be able to know about the version of our MySQL server. To get the version we should have to write the following command on command line −C:\mysql\bin>mysqladmin -u root version mysqladmin Ver 8.42 Distrib 5.7.20, for Win64 on x86_64 Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Server version       5.7.20 Protocol version     10 Connection           localhost via TCP/IP TCP port   ... Read More

How can I know whether MySQL Server is alive or not?

Krantik Chavan
Updated on 20-Jun-2020 11:20:21

256 Views

With the help of ‘mysqladmin’ program, we would be able to know whether our MySQLserver is alive or not. It can be used as follows on the command line −C:\mysql\bin>mysqladmin -u root ping mysqld is aliveThe message after running the command shows that our MySQL server is alive.

How can I start MySQL Server?

Nikitha N
Updated on 20-Jun-2020 11:21:06

405 Views

There are following two methods to start MySQL server −Using Command LineWe need to run ‘mysqld’ program to run MySQL server. It can be started using the command line with the help of the following command −C:\mysql\bin>mysqldWe will see nothing after entering the ‘mysqld’ command because it will not print any message in the command window. We should have to trust that MySQL server is running now.Using file explorer windowWe can also start MySQL server by double-clicking the file \mysql\bin\mysqld.exe on our computer.

Which function is a synonym of MySQL LENGTH() function?

Moumita
Updated on 20-Jun-2020 11:21:50

78 Views

As we know that, MySQL OCTET_LENGTH() function also measures the string length in ‘bytes’ hence, it is the synonym of MySQL LENGTH() function. The syntax of this function is OCTET_LENGTH(Str) where Str is a string whose length in characters has to be returned.It is also not multi-byte safe like LENGTH() function. For example, if a string contains four 2-bytes characters then OCTET_LENGTH() function will return 8. It is demonstrated in the example below −Examplemysql> Select OCTET_LENGTH('tutorialspoint'); +--------------------------------+ | OCTET_LENGTH('tutorialspoint') | +--------------------------------+ |                             14 | +--------------------------------+ 1 ... Read More

When MySQL SUBSTRING_INDEX() function returns the same string, provided in the argument, as output?

Lakshmi Srinivas
Updated on 20-Jun-2020 11:30:02

118 Views

MySQL SUBSTRING_INDEX() function will return the same string as output if the argument ‘count’ has the value greater than the total number of occurrences of delimiter. It can be demonstrated with the following example −mysql> Select SUBSTRING_INDEX('www.google.co.in','.',4); +-------------------------------------------+ | SUBSTRING_INDEX('www.google.co.in','.',4) | +-------------------------------------------+ | www.google.co.in                          | +-------------------------------------------+ 1 row in set (0.00 sec)The above query returns the same string because 4 is greater than the total number of occurrences of delimiter provided as argument i.e. ‘.’.

How can column data values of a table be compared using MySQL STRCMP() function?

Manikanth Mani
Updated on 20-Jun-2020 11:08:32

115 Views

If we want to compare the data values of two columns then we need to provide the name of the columns as arguments of MySQL STRCMP() function. Suppose we have a table named ‘Marks’ which contains the name of the student and their secured marks in different subjects. Now, if we want to know that a particular student has got more or less or equal marks in two subjects then it can be illustrated using STRCMP() function as follows −Examplemysql> Select Name, STRCMP(Math, Hindi) from student marks WHERE Name = 'Rahul'; +-------+--------------------+ | Name  | STRCMP(Math, Hindi) | +-------+--------------------+ | ... Read More

How number values be used as arguments in MySQL STRCMP() function?

karthikeya Boyini
Updated on 10-Feb-2020 06:30:48

93 Views

For the purpose of comparison, we can use number values as an argument in STRCMP() function. They are given as arguments without quotes. Following example will demonstrate it.Examplemysql> Select STRCMP(10, 10)As 'Equal Numbers', STRCMP(11, 10)AS '2nd Smaller', STRCMP(10, 11)AS '1st Smaller', STRCMP(10, NULL)As '2nd NULL', STRCMP(NULL, 10)AS '1st NULL', STRCMP(NULL, NULL)AS 'Both NULL'; +---------------+-------------+-------------+----------+----------+-----------+ | Equal Numbers | 2nd Smaller | 1st Smaller | 2nd NULL | 1st NULL | Both NULL | +---------------+-------------+-------------+----------+----------+-----------+ | 0             | 1           | -1          | NULL     | ... Read More

How MySQL LEFT JOIN can be used to simulate the MySQL MINUS query?

Nitya Raut
Updated on 20-Jun-2020 11:31:04

801 Views

Since we cannot use MINUS query in MySQL, we will use LEFT JOIN to simulate the MINUS query. It can be understood with the help of the following example:ExampleIn this example, we are two tables namely Student_detail and Student_info having the following data −mysql> Select * from Student_detail; +-----------+---------+------------+------------+ | studentid | Name    | Address    | Subject    | +-----------+---------+------------+------------+ | 101       | YashPal | Amritsar   | History    | | 105       | Gaurav  | Chandigarh | Literature | | 130       | Ram     | Jhansi   ... Read More

How can we find the duplicate values available in a MySQL table by using JOINS?

varma
Updated on 10-Feb-2020 06:29:05

54 Views

Suppose we have the following table named ‘stock_item’ in which the column quantity is having duplicate values i.e. for item name ‘Notebooks’ and ‘Pencil’, the column ‘Quantity’ is having duplicate values ‘40’ as shown in the table.mysql> Select * from stock_item; +------------+----------+ | item_name  |quantity  | +------------+----------+ | Calculator |       89 | | Notebooks  |       40 | | Pencil     |       40 | | Pens       |       32 | | Shirts     |       29 | | Shoes      |   ... Read More

Advertisements