SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Change password in WinMySQLadmin ??

    I tried to get an answer to this in the DB forum but NO reply.

    Change password in WinMySQLadmin ??
    Anyone tell me how to change/find the password in WinMySQLadmin and/or change the password in MySQL.

    I installed php/apache/mysql on my system and it seems that something happened when I changed over to a cable connection and now my db is password protected.

    BTW,this is only a db on my own system that I'm using for test purposes and I dont want to do a whole new install.

    Thanks

  2. #2
    SitePoint Addict joyce's Avatar
    Join Date
    Aug 2001
    Posts
    295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this:

    open the winmysqladmin window, clicked the my.ini setup, below there u can change your username and password, and then save the modification. i think tat should work..

  3. #3
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your probably correct but when I hit "Pick-up and Edit my.ini values" NOTHING happens.

    Most frustrating....but I really appreciate the reply.

  4. #4
    blonde.... Sarah's Avatar
    Join Date
    Jul 2001
    Location
    Berkshire, UK
    Posts
    7,442
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi Motivated, can you access the dB at all? if so you should be able to use grant/revoke and create another user of change the password of an existing user. Check out this link
    Regular user

  5. #5
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Sarah,I'll check it out.

    I'm trying to create a new DB from a script,I really dont have a clue what has happened.All I know is that everything was fine prior to getting cable.

    I was just reading up on grant/revoke but I have soooo much trouble understanding this MySQL dribble.

    Thanks again

  6. #6
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    From MySQL3.23.51 onwards, please look for the following files (depending on your dbase-type config).
    ** my-huge. / my-small. / my-large. / my-medium.cnf **.

    There's a good chance that one among the above files is acting as the default. It would've been renamed to "my.cnf" or "my.ini". Look for that file in the "MySQL-installed-partition-root" like C:\ / "MySQL-installation-folder" like C:\MySQL or in C:\Windows. Your password and username would be in that file. You can manually edit that file with a ASCII-text editor.

    hth

    PS:
    * the above works for all Windows OS. Don't know of *nix variants
    * You said something about getting cable, so assuming it's no coincidence...check what's under "LocalHost" and "Local IP Address" fields of the ENVIRONMENT tab of WinMySQLAdmin. If there's something out of sorts there, post that in the forum. The database heavies here will solve your problem in a jiffy
    Last edited by then; Oct 15, 2002 at 03:48.
    O Nobly Born, be thou grave and courteous in thy speech; quick to succour and slow to flame.

  7. #7
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont even have a clue what an ASCII-text editor is ??
    What is involved in using it or anything else.

    So here is a FULL REPORT of what is happening :

    THIS IS IN WinMySQLadmin:

    Local Host Name: DIT (I dont remember putting this in)
    Local User NAME: dit (I dont remember putting this in)
    OS Platform : Win98
    Local IP Address: jasmine(Dont remember ever putting that in and jasmine is the name for cable connection (plus an IP number (192.***.*.*) which I believe is my computer but its NOT localhost(127.0.0.1))

    Heres the script I'm trying to run:

    <?php

    if(!$_POST['test'])

    {

    ?>
    <html>
    <head>
    <title>TEST</title>
    </head>
    <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
    <B><font size="4">This is my test</font></B>
    <P>&nbsp;<P>
    <input type="submit" name="test" value="test">
    </form>
    </html>

    <?php

    }

    elseif($_POST['test'])
    {
    $host="localhost";
    $user="user";
    $password="passwd";
    $dbname="newdatabase";
    $link=mysql_connect($host,$user,$password);
    }

    if(mysql_create_db($dbname,$link))
    {
    echo("The database was successfully created<br>");
    }

    else
    {
    echo("The database $dbname could not be created <br>");
    }

    mysql_close($link);
    ?>

    Heres what I get when I call the script :
    Notice: Undefined index: test in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 4

    Notice: Undefined variable: dbname in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 33

    Notice: Undefined variable: link in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 33

    Warning: mysql_create_db(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 33

    Notice: Undefined variable: dbname in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 40
    The database could not be created

    Notice: Undefined variable: link in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 43

    Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 43


    And heres what I get AFTER running the script:

    Warning: Access denied for user: 'user@localhost' (Using password: YES) in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 30

    Warning: MySQL Connection Failed: Access denied for user: 'user@localhost' (Using password: YES) in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 30

    Warning: mysql_create_db(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 33
    The database newdatabase could not be created

    Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 43

    HELLLLLLLLLLLLLP !!!
    please
    Last edited by Motivated; Oct 15, 2002 at 06:52.

  8. #8
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Motivated
    I dont even have a clue what an ASCII-text editor is ??
    Notepad is an example, vi (Unix), emacs are others (also Unix).

    THIS IS IN WinMySQLadmin:

    Local Host Name: DIT (I dont remember putting this in)
    Local User NAME: dit (I dont remember putting this in)
    OS Platform : Win98
    Local IP Address: jasmine(Dont remember ever putting that in and jasmine is the name for cable connection (plus an IP number (192.***.*.*) which I believe is my computer but its NOT localhost(127.0.0.1))
    I personally don't use WinMySQLadmin, I used to but not anymore. As far as I remember, during the setup mysql ask you for the manager username and password. Now by default, mysql for Windows accepts any connection from any user without asking a password as long as they are made from localhost. That means you can replace mysql_connect($host,$user,$password) with mysql_connect($host) and that should work.

    I'm asumming you are using mysql and php just to work locally, ie, nobody can connect to your web server, otherwise you have to create or recreate a mysql user using the GRANT command.

    Paul

  9. #9
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I opened my.ini and it has exactly the same thing as WinMySQLadmin :
    ......................................
    [WinMySQLAdmin]
    Server=C:/MYSQL/bin/mysqld-opt.exe
    ......................................
    Thats its TOTAL contents.

    Now I'm beginning to believe its something to do with my network settings or it could be perhaps my firewall,but I'm sure it was working fine before the network was installed with the firewall up.

    Thanks ALL for your help.

  10. #10
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have removed your other thread and put this one here. Please do not cross-post

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  11. #11
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Warning: Access denied for user: 'user@localhost' (Using password: YES) in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 30
    means that the said user does not have permission to CREATE DATABASE on the localhost. Please check the "Privileges" table in the "MySQL" database for what privileges the USER has. I think that's what causing all the problems.

    Further, you can make life a lot easier for yourself by getting MyCC from http://www.mysql.com/downloads/gui-mycc.html . It's a simple, yet powerful GUI for MySQL database. Use it to check the privileges for the USER or edit/GRANT USER's privileges.

    I would suggest that you create a super user with all privilges and NEVER USE the super user in your scripts. Instead create a regular user with limited privileges like CREATE, UPDATE and SELECT. That way the ordinary user in the scripts can't do any accidental damage to the database. Operate the super user only from the command prompt / GUI so that you are focused solely on specific admin stuff.

    Btw, I too am on Win'98 and here's what my "my.ini" file located in WINDOWS directory looks like...
    ********************
    [WinMySQLAdmin]
    Server=C:/MYSQL/bin/mysqld-max.exe
    user=xxxxxxx
    password=xxxxx

    [mysqld]
    basedir=C:/MYSQL
    #bind-address=192.***.*.**
    datadir=C:/MYSQL/data
    #language=C:/MYSQL/share/your language directory
    #slow query log#=
    #tmpdir#=
    #port=3306
    #set-variable=key_buffer=16M
    ********************
    You can Edit/Create the user and password values in the "my.ini" file with Notepad. IP addresses starting with 192 mean the you are in a private/shared domain. But, I don't think that's the cause of the problem.
    Notice: Undefined index: test in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 4
    Notice: Undefined variable: dbname in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 33
    Notice: Undefined variable: link in C:\Program Files\Apache Group\Apache\htdocs\test_db.php on line 33
    The above errors point are PHP errors, I don't think they have anything to do with MySQL. Not very sure though . Please look up the PHP manual for examples and user comments, that could be of some help to you.

    hth & best of luck
    theN
    Last edited by then; Oct 15, 2002 at 12:19.
    O Nobly Born, be thou grave and courteous in thy speech; quick to succour and slow to flame.

  12. #12
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now this is really strange because I have never set any priv's in mysql and to be honest I wouldn't know how at this stage.

    I haven't used mysql yet for building anything.

    OK,so I'm off to get MyCC and hope that can put some light on the situation.

    Hey...thanks for all your time and help,I appreciate it.

  13. #13
    SitePoint Guru
    Join Date
    Feb 2002
    Location
    NZ
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it possible that because my computer has been networked that my script is trying to access one of the other puters in this room instead of mine.

    I dont know anything about this network stuff and have had to rely on one of the others in here to set it up.

  14. #14
    SitePoint Enthusiast
    Join Date
    Oct 2002
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    really strange because I have never set any priv's in mysql
    your previous post indicates a USERNAME=DIT. AFAIK that user is not created by default. If you didn't create that user, then I'm guessing that the username is being read from an older installation.

    All I can say is this-
    * un-install MySQL and clean up the registry & delete all "my.cnf" and "my.ini" files. Install MySQL again.
    OR
    * use MyCC to delete the user DIT and create another user with limited SELECT, UPDATE, CREATE privileges and use this news user in your scripts.

    I think a fresh install is a better option at this juncture. Since you are on Win'98, the whole procedure would take about 3minutes.

    hth
    theN
    O Nobly Born, be thou grave and courteous in thy speech; quick to succour and slow to flame.


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
  •