How to create a new database, user, and grant permissions using mysql

In this tutorial we will discuss how to make a database using the mysql command line tool.

What is mysql? An open source database management tool that helps a user store, organize and retrieve data. It helps an administrator define user types, permissions and so forth. Generally when installing open source software such as Drupal or Wordpress you will need to create a new database and user with permissions.

Let's keep it simple:

  1. How to create a new user
    • CREATE USER 'your_new_user_here'@'localhost' IDENTIFIED BY 'your_password_here';

  2. Assign permissions to your new user, and new database
    • GRANT ALL PRIVILEGES ON 'new_database_name' . * TO 'your_new_user_here'@'localhost';
  3. Create a new database
    • CREATE DATABASE 'new_database_name';
  4. Flush privalages - do not forget this!
    • FLUSH PRIVILEGES;


  • 4 Users Found This Useful
Was this answer helpful?

Powered by WHMCompleteSolution