Nota Acap
  • Introduction
  • Linux Guide
    • Fresh Installed Centos 7
    • Changing Network Interfaces in Centos 7
    • Lockdown SSH
    • Recursively change permission Linux
    • Proxy Server IPtables
    • Provisioning Web Server with Custombuild
    • MySQL Basic Management
    • Increasing Existing LVM Disk
  • Windows Guide
  • Application Guide
    • WEB Port IPtables Rate Limit
    • Simple Email Piping Script
    • HTTP Dead
    • Email Relay Outgoing
    • Compiling Extra PHP version (Directadmin)
    • Finding the SPAM (cPanel)
    • HTTP Basic Virtual Host
    • Update Kernel for DRBD Hosts
  • Migration Related
    • Cpanel -> Cpanel (Bulk)
    • IMAPSYNC Basic Scripts
    • Directadmin -> cPanel (Copy/Sync Emails)
    • Basic Rsync Script
Powered by GitBook
On this page

Was this helpful?

  1. Linux Guide

MySQL Basic Management

This guide will show you the basic MySQL command in adding database,users with password and also assign ownership/permission for a user to a database

  1. First login to your mysql database via root :

mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 18
Server version: 10.3.13-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

2. Use below commands to create database and create user that have access to the databases

create database [database name];
grant all on [database name].* to '[database user]'@'%' identified by '[database user password]';
flush privileges;
quit;

please change [database name] , [database user] and [database user password] accordingly to your needs

3. Finally to test, login as the new user and use command :

show databases;

4. It is working if the output shows the new database.

PreviousProvisioning Web Server with CustombuildNextIncreasing Existing LVM Disk

Last updated 2 years ago

Was this helpful?