Mkotla has Published 97 Articles

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

mkotla

mkotla

Updated on 20-Jun-2020 11:41:28

464 Views

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

What MySQL would return if we refer a user variable which is not assigned any value explicitly?

mkotla

mkotla

Updated on 20-Jun-2020 10:49:23

104 Views

In case, when we refer a user variable which is not assigned any value explicitly, MySQL would return NULL. In other words, its value would be NULL. Following example would illustrate it −mysql> Select @X, @Y, @Z, @S, @G; +------+-------+----------+------+------+ | @X   | @Y    | @Z     ... Read More

How can I restore multiple databases or all databases dumped by mysqldump?

mkotla

mkotla

Updated on 20-Jun-2020 10:43:22

4K+ Views

Suppose if we have dumped multiple databases or all the databases and now want to restore it then we can do it with the following example −C:\mysql\bin>mysql -u root < tutorials_query1.sqlWith the help of above query, we are restoring the dumped multiple databases named ‘tutorials’ and ‘query1’, which are dumped ... Read More

How can we transfer information between MySQL and data files?

mkotla

mkotla

Updated on 20-Jun-2020 09:14:18

154 Views

Transferring the information between MySQL and data files mean importing data from data files into our database or exporting data from our database into files. MySQL is having two statements that can be used to import or export data between MySQL and data files −LOAD DATA INFILEThis statement is used ... Read More

What is the maximum length of data we can put in a TEXT column in MySQL?

mkotla

mkotla

Updated on 20-Jun-2020 08:31:13

4K+ Views

As we know TEXT data objects are useful for storing long-form text strings. The different TEXT objects offer a range of storage space from 255 bytes to 4 Gb. The following table shows the storage of different kinds of TEXT data type −Type of BLOBMaximum amount of Data that can ... Read More

On inserting ‘NULL’, ‘0’ or No Value to the column, will MySQL assign sequence number for AUTO_INCREMENT column?

mkotla

mkotla

Updated on 20-Jun-2020 07:36:00

473 Views

MySQL will automatically assign sequence numbers to the AUTO_INCREMENT column even if we insert NULL, 0 or No Value to the column in a table.Examplemysql> create table test123(id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, Name Varchar(10)); Query OK, 0 rows affected (0.15 sec)The query above created a MySQL table named ... Read More

What is onmouseup event in JavaScript?

mkotla

mkotla

Updated on 19-Jun-2020 11:16:53

868 Views

The onmouseup event triggers when a mouse button is released.ExampleYou can try to run the following code to learn how to work with onmouseup event in JavaScript −                                         This is demo text for mouseup event.    

How to test if a JavaScript cookie has expired?

mkotla

mkotla

Updated on 17-Jun-2020 06:43:19

3K+ Views

To test if a cookie has expired in JavaScript, add the following condition and check −if( !($.cookie('myCookie') === null) ) {    // Do something (cookie exists) } else {    // Do something (cookie expired) }You can also check it using a single line code −checkCookie = $.cookie('myCookie') === null ? ( /*Condition TRUE...*/ ) : ( /*Condition FALSE...*/ );

How to get a decimal portion of a number with JavaScript?

mkotla

mkotla

Updated on 17-Jun-2020 06:35:57

3K+ Views

With JavaScript, use the % operator to get the decimal portion of a number.ExampleYou can try to run the following to get decimal portion −Live Demo                    var num1 = 5.3;          var num2 = 4.2;          var num3 = 8.6;          document.write(num1 % 1);          document.write(""+num2 % 1);          document.write(""+num3 % 1);           Output0.2999999999999998 0.20000000000000018 0.5999999999999996

Why in JavaScript, “if ('0' == false)” is equal to false whereas it gives true in “if(0)” statement?

mkotla

mkotla

Updated on 16-Jun-2020 13:28:37

2K+ Views

Let’s see the conditions one by one − if(‘0’ == false)It follows the following rule −If Type(y) is Boolean, return the result of the comparison x == ToNumber(y)The == does type coercion. This means an explicit type conversion is requested to match the type of the two operands. The left side ... Read More

Advertisements