Creating new Database and a new table in MySQL via PhpMyAdmin

Login to your PhpMyAdmin page,

 

Syntax:

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

CREATE DATABASE `DialogDB` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `<MyDBName>`;

CREATE TABLE IF NOT EXISTS `<MyTableName>` (
  `userID` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(50) NOT NULL,
  `password` varbinary(250) NOT NULL,
  PRIMARY KEY (`userID`,`username`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

 

Example:

image

 

Output:

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";# MySQL returned an empty result set (i.e. zero rows).

SET time_zone = "+00:00";# MySQL returned an empty result set (i.e. zero rows).

CREATE DATABASE `DialogDB` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;# 1 row affected.

USE `DialogDB`;# MySQL returned an empty result set (i.e. zero rows).

 

CREATE TABLE IF NOT EXISTS `users` (
  `userID` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(50) NOT NULL,
  `password` varbinary(250) NOT NULL,
  PRIMARY KEY (`userID`,`username`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;# MySQL returned an empty result set (i.e. zero rows).

Leave a Reply

Your email address will not be published. Required fields are marked *