Code Monkey home page Code Monkey logo

js-basic's Introduction

Setup code

npm i

Create user

CREATE USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password';

If your account lock

ALTER USER 'user'@'localhost' ACCOUNT UNLOCK;

Grant all access

GRANT ALL PRIVILEGES ON name_database.* TO 'username'@'localhost';
FLUSH PRIVILEGES;

or all database

GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost';
FLUSH PRIVILEGES;

Check grant access

SHOW GRANTS FOR 'username'@'localhost';

or

SELECT 
    u.User AS 'Username',
    u.Host AS 'Host',
    d.Db AS 'Database'
FROM 
    mysql.user u
LEFT JOIN 
    mysql.db d 
ON 
    u.User = d.User AND u.Host = d.Host
WHERE
    u.User = 'username';

Show user

SELECT User, Host FROM mysql.user;

Show all databse

SHOW DATABASES

Create Database

CREATE DATABASE name_db;
  • Use database
    USE name_db;
    
  • Remove database
    DROP DATABASE name_db;
    
  • Show all databse
    SHOW DATABASES;
    
  • Show table
    SHOW TABLES;
    
  • Describe table
    DESCRIBE name_table;
    

js-basic's People

Contributors

apt3233 avatar

Stargazers

Rio avatar  avatar  avatar Nguyễn Thuận Thành avatar

Watchers

Nguyễn Thuận Thành avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.