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

creating a new user in mysql

Here we are creating user with name manish and password for manish is password;

Creating a user and force user to change password at first login for that PASSWORD EXPIRE is used.

Creating a user and expiring the password after 180 days, PASSWORD EXPIRE INTERVAL 180 DAY is used

Creating a user … Read more

Alter table command to add foreign key

We have two tables company and location. First table manages company details and second table stores location detail of company. one company can span in multiple location. Initially we have created table for company and location as below.

checking the description of both table

Now We find that one company can … Read more

Drop foreign key constraints

Some times we have to drop the foreign key constraint that already exists, for that we have to first get the foreign key constraint name. To see detailed description of created table we use following query.

Result of above query is

Here we can see that company_id column is referring company tables id … Read more

Crud operations in PHP using mysqli and PHPMyAdmin

PHP MySQL CRUD involves the connection of PHP with the MySQL database and performing Create (Insert), Read (Select), Update (Modify), and Delete Operation on the table. PHP and MySQL connectivity is a very important topic while learning PHP here step by step PHP and MySQL connectivity and creat update delete and read operations are discussed using … Read more

Show mysql create table query

To see created table structure show create table command is used Syntax

Example

Result

To avoid showing leading and trailing dots we use \G with command syntax is as below Example

Result *************************** 1. row *************************** Table: student Create Table: CREATE TABLE student ( id int(11) DEFAULT NULL, first_name varchar(30) DEFAULT … Read more

Set time zone in mysql

To set Time zone in GMT set time_zone is used with specified time_zone value

  To check our change reflated on database use following query

 

  Read More Setting innodb_lock_wait_timeout Granting Privileges to users Show engine innodb status Finding all column name of table