Creating new user in mysql in WAMP server

Discussion in 'MySQL' started by weborbit, Aug 10, 2012.

  1. #1
    I am new to the php and mysql world right now i am using default username and password in the mysql database i.e. root and password blank, i want to know how can i create new user in mysql when i use wamp server?
     
    weborbit, Aug 10, 2012 IP
  2. sources68

    sources68 Member

    Messages:
    74
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #2
    You can using command
    GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
    FLUSH PRIVILEGES;

    GRANT ALL PRIVILEGES ON wapcontent.* TO wapcontent@'%' IDENTIFIED BY '123456';
    FLUSH PRIVILEGES;
     
    sources68, Aug 10, 2012 IP
  3. whrsstech

    whrsstech Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, the command specified by sources68 would create a new user for you. This command should be run from the MySQL prompt of the server. You can connect to the mysql prompt from the command line. The location might be similar to "C:\Program Files\MySQL\MySql Server 5.1\bin". You have to get inside the bin directory of mysql from command line and type "mysql -u root -p"password" -P 3306" to get connected to the MySQL prompt.
     
    whrsstech, Aug 15, 2012 IP
  4. computerkid

    computerkid Greenhorn

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    8
    #4
    You can create user from command prompt using following command grant CREATE,INSERT,DELETE,UPDATE,SELECT on mydb.* to username@localhost;set password for username = password('mysecretpassword');
     
    computerkid, Aug 26, 2012 IP
  5. nannysingh

    nannysingh Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I have installed MySql using WAMP.
    create a database and an administrator for that database:
    1. create a user using "mysqladmin...create" command
    2. login with this user using "mysql" command
    3. Grant the user with database priviliges with the GRANT command
    4. activate those priviliges with Flush priviliges command.
     
    nannysingh, Oct 3, 2012 IP