Mac OS

    How to create new user in mysql

    To create new user in mysql. Login to mysql and run following commands:
    mysql> CREATE USER 'mohitsharma'@'localhost' IDENTIFIED BY 'secretpassword';

    mysql> GRANT ALL PRIVILEGES ON * . * TO 'mohitsharma'@'localhost';

    to grant specific permission to table to database will be covered in other chapter


    mysql> FLUSH PRIVILEGES;

    mysql> exit

    $: mysql -u mohitsharma -p and Enter
    Easy & Done :)