Monday, November 29, 2010

Create MySQL user account and priviledge from the Terminal

  1. Open a terminal and login to MySQL as root:
    mysql --user="root" --password="your_root_password"
  2. Create a new user and password with the following command:
    CREATE USER 'new_username'@'localhost' IDENTIFIED BY 'password_for_new_username';
  3. Assign privileges to the new user, enter the command:
    GRANT ALL ON *.* TO 'new_username'@'localhost';
  4. Exit MySQL interface, enter:
    exit

No comments:

Post a Comment