MySql dump using java

A MySQL dump, also known simply as a “dump,” is a process of exporting or backing up the data and structure of a MySQL database into a file. This file contains a snapshot of the database’s contents at a specific point in time, making it useful for various purposes, such as: To create a MySQL … Read more

Setting innodb_lock_wait_timeout

What is innodb_lock_wait_timeout ? In MySql innodb_lock_wait_timeout is an Innodb transaction wait time in seconds for a row lock. An another transaction has to wait for specified innodb_lock_wait_timeout if a transaction is taking place.  innodb-lock-wait-timeout in a system variable in global and session scope this variable can set dynamically to both scopes. We can set … Read more

Granting Privileges to users

After creating user. Privileges are granter to user to access specific database or to access all databases in mysql GRANT ALL will give all privileges to user To Grant All privileges to user following query is used

To provide all privileges on specific database following query is used

To provide all privileges on … Read more

How to Add a Default Value to a Column in MySQL

We can provide a default value for a column. If we don specify its value, it will automatically assign a default value. What is the Default value in MySql n MySQL, the default value is a predefined value that is assigned to a column if no explicit value is provided during the insertion of a … Read more

Finding all column name of table

Suppose we have a table user and we want to fetch all its column name.For this we use INFORMATION_SCHEMA. we will use following query to fetch all column name of table

  Above query will fetch all columns of user table available in social database. Read More Setting innodb_lock_wait_timeout Set time zone in mysql … Read more

Drop command: To eliminate a column from a table.

To eliminate a column from table we use drop command. Suppose we have table employee with an extra field Address and we want to eliminate this.

To remove this column we use Drop query. Syntax:

Read More How to create a table in MySql

How to create a table in MySql

MySQL is a widely used relational database management system. It is used by developers, database administrators, and data analysts to store and manage data. In this tutorial, we will discuss how to create a table in MySQL using the CREATE TABLE statement. The CREATE TABLE statement is used to create a new table in a … Read more

Give initial auto increment value while table creation

When we create a table we can give a auto increment value to a primary key filed. This field is auto incremented by one for newly inserted value. To start auto increment from specified number AUTO_INCREMENT = value is used while creating table. Example:

If you have already created a table and then want … Read more

Drop command to remove a column from a table.

suppose we have a column address in table employee.

To see the description of table we use desc employee that will produce following result here we can see the description of table.

if we want to eliminate the column address from employee table then we use Drop command. Syntax:

Drop query

Read more

Date and Time

There are various pre defined function for data and time we will see them one by one. If you want to show current time then we use CURTIME().It returns time in HH:MM:SS string format

below is HHMMSS in numeric format

To select current data we use CURDATE().It returns data in YYYY-MM-DD string format. … Read more