SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    May 2002
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question changing root password in mysql

    Hi all,
    I've recently received a copy of 'Build Your Own Database Driven Website' by Kevin Yank.

    I'm new to PHP and MySQL and one of the things that I'm trying to figure out is what syntax to use to perform the task of resetting the root password for mysql on page 119? I'm using Windows 2000 and it doesn't like the syntax in the book. Also, does anyone know how to change the root password at any given time??? Your help will be greatly appreciated.

    New and confused???

  2. #2
    Weird Little Girl Desdelena's Avatar
    Join Date
    May 2002
    Location
    Canada
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ive never actually done this... but if you look in your php.ini file you should find the following on lines 383-385.

    mysql.default_host = ; default host for mysql_connect() (doesn't apply in safe mode)
    mysql.default_user = ; default user for mysql_connect() (doesn't apply in safe mode)
    mysql.default_password = ; default password for mysql_connect() (doesn't apply in safe mode)
    ; Note that this is generally a *bad* idea to store passwords
    ; in this file. *Any* user with PHP access can run
    ; 'echo cfg_get_var("mysql.default_password")' and reveal that
    ; password! And of course, any users with read access to this
    ; file will be able to reveal the password as well.
    I believe you just edit it by placing your password in the file and saving it after you are done. However according to my php.ini file quoted above it may not be the best idea. Why not just create a user and password in phpMyAdmin?

  3. #3
    SitePoint Guru Majglow's Avatar
    Join Date
    Aug 1999
    Location
    B-Town
    Posts
    645
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,

    Hmmm, I don't have the book, is it written as if it was Unix?

    Anyway, this is what you should do.

    (First make sure that MySQL is properly insalled )

    Then, go to the command prompt, and change directories until you get to the directory with the executables.

    Make sure that mysqladmin is present in the directory.

    Then type "mysqladmin -u root password NEW_PASSWORD".

    Then follow directions.

    Some more resouces:

    http://perl.about.com/library/weekly/aa111400a.htm How to install MySQL on windows

    http://www.devshed.com/Server_Side/M...ion/page1.html Tutorial for beginning MySQL administration

    http://www.mysql.com/doc/ Last, but far from least. If all else fails, refer to the Mysql documentation.

    -cARL
    Ohai!

  4. #4
    SitePoint Member
    Join Date
    May 2002
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all,

    I have a similar problem so I hope I can add it to this thread.
    I'm totally new to mysql+phpAdmin so I'm following all tutorials I find etc.
    I installed with EasyPHP on Win2k.
    I used PHPAdmin to change the root password, and it shows up correctly.
    Then I found the syntax to change it from the cmd line and it looked like it worked ok, as it was giving me infos on the status.
    I tried then with the reload command, but since then I can't log in as root (or anybody else) from the command line - mind you, from PHPAdmin everything seems to be working.
    I'm confused! I thought PHPAdmin was a nice interface for the same thing.
    Also, I don't have php.ini on the system at all, possibly Easyphp didn't need it?
    I'm following a great tutorial at http://www.mysql.com/articles/ddws/7.html
    Thanks a lot!
    J


Bookmarks

Posting Permissions

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