Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2006
    Posts
    63

    Unanswered: Create user password problem

    Hi folks,

    Ubuntu-6.06.1-LAMP-server-amd64
    MySQL Ver 14.12 Distrib 5.0.22, for pc-linux-gnu (x86_64) using readline 5.1.

    Encountered problem on creating user password. Steps performed as follows;

    $ mysql -u root -p
    Enter password:
    Code:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 11 to server version: 5.0.22-Debian_0ubuntu6.06.2-lo g
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    mysql> creat user 'satimis'@'localhost' password satimispassword;
    Code:
    ERROR 1064 (42000): You have an error in your 
    SQL syntax; check the manual that corresponds to
    your MySQL server version for the right syntax to
    use near 'creat user 'satimis'@'localhost' password 
    satimissql' at line 1
    Looking at "13.5.1.1. CREATE USER Syntax"
    http://www.mysql.org/doc/refman/5.0/en/create-user.html

    I can't resolve the correct syntax. Please advise. TIA


    B.R.
    satimis

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    i'd try
    create user 'satimis'@'localhost' identified by 'satimispassword';

    its a heck of a lot easier to do this using MySQL Administrator though

    you also need to GRANT permissions to this user to databases & databases objects.
    And then FLUSH Privileges to ensure that MySQL relaods the privileges.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2006
    Posts
    63
    Hi healdem,

    Tks for your advice.

    I got it done.

    mysql> create user 'satimis'@'localhost' identified by 'satimispassword';
    Code:
    Query OK, 0 rows affected (0.03 sec)
    
    mysql>
    its a heck of a lot easier to do this using MySQL Administrator though
    I do agree with you. I'm trying to learn the basic.

    you also need to GRANT permissions to this user to databases & databases objects.
    And then FLUSH Privileges to ensure that MySQL relaods the privileges.
    Would this section relevant?

    13.5.1.3. GRANT Syntax
    http://www.mysql.org/doc/refman/5.0/en/grant.html

    TIA


    B.R.
    satimis

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    ...yes

    for a development server, especially when you are just starting out using MySQL then Id suggest you use...
    GRANT ALL ON *.* TO <userid> IDENTIFIED BY '<yourpasword>'

    however it is suggested only whne you first start out, when it can be a bit intimidating to get a server awake. Once you are happy you have the server workign, and up to speed with the MYSQL security model then you should dedcide what your security policies are, and how you want to apply those policies in MySQL. As a geenral rule a user should only have access to the do thes tasks they need to, on the objects they need to on the dataabases they use, apart formt hat they should have no other access. One thing that I think missing in MySQL security is the concept of Roles... it may now be introduced in V5, but it hasn't when I Last looked at mySQL security
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jun 2006
    Posts
    63
    Hi healdem,

    for a development server, especially when you are just starting out using MySQL then Id suggest you use...
    GRANT ALL ON *.* TO <userid> IDENTIFIED BY '<yourpasword>'
    $ mysql -u root -p
    Enter password:
    Code:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 15 to server version: 5.0.22-Debian_0ubuntu6.06.2-log
    
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    mysql> grant all on *.* to satimis@localhost identified by 'rootpassword';
    Code:
    Query OK, 0 rows affected (0.01 sec)
    I got it done. Tks.

    I spent a while to find out <userid>. I though it was "satimis" only.

    But still having problem;

    $ sudo /etc/init.d/mysql restart
    Password:
    Code:
    Stopping MySQL database server: mysqld...failed.
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
    Killing MySQL database server by signal: mysqld.
    Starting MySQL database server: mysqld.
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
    satimis@ubuntu:~$ /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
    (it was hanging here)
    Waiting for input or NOT working? Pressing [Enter] prompted "satimis@ubuntu:~$"

    Please advise how to fix the problem. What is
    Code:
    error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'
    TIA

    Others noted with tks.


    B.R.
    satimis

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    what do you think this error message means
    "error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'"


    ...think about it


    ...what is it actually saying


    ...could it be informing you of the problem its experiencing


    ...if so it may be telling you explicitly that its expecting to find a user called "debian-sys-maint" from host "localhost" with specific privileges. So you need to find if that user id & host exists... again MySQL Administrator makes these sort of tasks far easier..... If you are struggling to use the command line version then use it.

    apparently "debian-sys-maint" is a special userid used on debian systems to do syste tasks, and is called to shutdown MySQL. but then if you'd googled that you would already know. Its specific to debiuan Linux, and therefore outside the scope of this forum.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •