How to create a database Schema and user in Mysql using command-line

Database create database schema in mysql create user in mysql 60 times1 answer1 follower
0
Mel Khamlichi 103 Rep. Avishek Kumar edited question

How can I create a MySQL Database Schema? Also, I want a separate user who will have all the necessary privileges on this schema only. Is there any way to perform all these in Linux command-line?

♥ Spread the love ♥
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
0
Avishek Kumar 449 Rep. Avishek Kumar edited answer

To create the database schema and user for MySQL, you need to login to mysql.

  1. Login to MySQL

    Note: If MySQL Database is remote, you need to use -h viz.,

  2. Create a database say dokws_test

  3. Create a user say dokws_user

  4. If, you or the application is going to access this database remotely, you need to do

  5. Grant all the access on Database dokws_test to user dokws_user

  6. Clean MySQL Internal cache by Flushing Privileges.

  7. You should now be able to login to mysql with the newly created user ‘dokws_user’ having full access on database schema ‘dokws_test’.

    Optional

    You may list the database, you have access to. Notice the newly created database ‘dokws_test’ is there.

♥ Spread the love ♥
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
×

Login