Fast guide to MySQL

This is just very little subset of command to help beginners with MySQL. Do not expect something extraordinary :)
All the command must be executed from mysql command prompt which you can reach with command:
mysql -u username -p password


1. Create database

CREATE DATABASE mybase;

2. Switch to use database

USE mybase;


3. Create user

CREATE USER myuser IDENTIFIED BY 'password';


4. Assign all right of user to database

GRANT ALL PRIVILEGES ON mybase.* TO 'myuser';

5. Flush privileges (to make them work at the moment)

FLUSH PRIVILEGES;

Be aware command are all caps, with small caps are parameters

No comments:

Post a Comment

Compressed tar archive

There are some cases when you want to create compressed tar archive but you do not have enough disk space to keep original files and tar arc...