Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: how do you set a mySQL root password?

  1. #1

    Default how do you set a mySQL root password?

    Hello,

    I'm trying to follow a mySQL setup guide and it advised me to use the command:

    opensuse11:~ # mysqladmin -u root -p rootpassword

    to set root password.

    Now, here's what I've done:

    Code:
    Please report any problems with the /usr/bin/mysqlbug script!
    
    Starting service MySQL                                                                                                                      done
    linux-2fs6:/usr/sbin # mysqladmin -u root password -p 88dabatase54
    Enter password: 
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: YES)'
    linux-2fs6:/usr/sbin # mysqladmin -u root password -p 88dabatase54
    Enter password: 
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: YES)'
    linux-2fs6:/usr/sbin # mysqladmin -u root password -p 88dabatase54
    Enter password: 
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: YES)'
    linux-2fs6:/usr/sbin # mysqladmin -u root password -p 88dabatase54
    Enter password: 
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: YES)'
    linux-2fs6:/usr/sbin # mysqladmin -u root password -p 88dabatase54
    Enter password: 
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: YES)'
    linux-2fs6:/usr/sbin # mysqladmin -u root password -p 88dabatase54
    Enter password: 
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: YES)'
    linux-2fs6:/usr/sbin # mysqladmin -u root password -p88dabatase54
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: YES)'
    Am I that retarded that I can't retype my 88dabatase554? I've also tried the machine root pass in one of the above cases .... can someone please help? Is there a default password one must use the very first time in setting a password? Is this not the first logical step after starting and installing it?

    Thanks,

    Alex

    p.s: the guide says there's no default password ... so is that simply wrong advice? ... argh .
    Last edited by bananapeal; 13-May-2011 at 17:18. Reason: im really dumb

  2. #2

    Default Re: how do you set a mySQL root password?

    omg omg... did it lock my dumb ass out? Here's what I got on another step:

    Code:
    linux-2fs6:/usr/sbin # mysqladmin -u root password -palex
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: YES)'
    what's going on here now?

  3. #3
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,941
    Blog Entries
    4

    Default Re: how do you set a mySQL root password?

    Where did you read that you use -p. You just type the password after the word password, like this:

    mysqladmin -u root password "alex"

    Quote the password to be safe, in case you have shell metacharacters in it.

  4. #4

    Default Re: how do you set a mySQL root password?

    wow, thanks ken_yap. My source is:

    source: Install & Configure LAMP (Apache/MySQL/PHP) in openSUSE 11.0 | SUSE & openSUSE (scroll down like a page or two)

    I realize it's from 2008 but it says suse 11.0 so I thought it would be relevant.

    Do you happen to know if phpMyAdmin got removed from suse 11.4 x64? I can't find it in yast2 anywhere!

    Thanks again!
    Last edited by bananapeal; 13-May-2011 at 17:46. Reason: 64bits

  5. #5
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,941
    Blog Entries
    4

    Default Re: how do you set a mySQL root password?

    It's in a contrib repo now, search for it at software.opensuse.org/search.

    Don't believe everything you read. In this case the man page for mysqladmin or the online documentation from MySQL would have set you on the right path.

    In fact if you had read the webpage you quoted more carefully you would have seen that your syntax doesn't work and the author provides the correct syntax.

  6. #6

    Default Re: how do you set a mySQL root password?

    ok.

    Thanks again. Going to try the official documentation guides. I just stopped short of watching some guy's youtube video ... ugh. why didn't they make xampp for 64 bit??!! gah. oh well. maybe I'll learn more this way.

  7. #7
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,058

    Default Re: how do you set a mySQL root password?

    If you are setting up mysql for the first time, it is easier to enter
    mysql -u root
    without a password as there is none. Then
    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password');
    SET PASSWORD FOR 'root'@'HOST_NAME' = PASSWORD('password');
    (replace 'HOST_NAME' with whatever appears as your host name when you open a console)

    There are two anonymous users in mysql.user which you need to delete or deal with in a way which is appropriate to what you are going to do. Otherwise, anyone will be able to log on without a password.

  8. #8
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,941
    Blog Entries
    4

    Default Re: how do you set a mySQL root password?

    Actually the easiest way to secure an installation is to run the provided script /usr/bin/mysql_secure_installation which prompts for the root password to set, removes the test database as well as removes the anonymous accounts.

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    22,432

    Default Re: how do you set a mySQL root password?

    On 2011-05-14 03:06, bananapeal wrote:
    > Do you happen to know if phpMyAdmin got removed from suse 11.4 x64? I
    > can't find it in yast2 anywhere!


    I have the vague recollection that it was removed because unsafe or too
    difficult to maintain.

    [...]

    Yes, that is. Search the factory mail list for this topic (Apr 2010):


    Subject: [opensuse-factory] phpMyAdmin on Factory?

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  10. #10
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,058

    Default Re: how do you set a mySQL root password?

    Quote Originally Posted by ken_yap View Post
    Actually the easiest way to secure an installation is to run the provided script /usr/bin/mysql_secure_installation which prompts for the root password to set, removes the test database as well as removes the anonymous accounts.
    That could do with turning into a How-to as this question gets asked regularly and I have previously answered as above but the 15 threads where this suggestion appears are scattered across several forums.

Page 1 of 2 12 LastLast

Posting Permissions

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