Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL cheatsheet #2

Open
alirezaomidi opened this issue Aug 29, 2015 · 0 comments
Open

MySQL cheatsheet #2

alirezaomidi opened this issue Aug 29, 2015 · 0 comments
Assignees
Labels

Comments

@alirezaomidi
Copy link
Member

Create database

create database [dbname];

Create user and grant access

create user '[user]'@'[host]' identified by '[pass]';
grant all privileges on dbname.* to '[user]'@'[host]';

Create a table

create table [dbname].[tablename] (
  field1 type1,
  filed2 type2
);

for this project:

create table fosscon.users (
  id int not null primary key auto_increment,
  email varchar(200),
  name varchar(200),
  phone varchar(20),
  stdnum varchar(7),
  workshop_num int,
  uniqid varchar(15)
);

Show tables

use [dbname];
show tables;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants