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

Should I trust AI

 Should I trust AI? So far no, sorry.  I tested for the moment (May, 2025) most advanced model for programming and ask very simple question:...