Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    12

    Cool Unanswered: how to change root password and port?

    Hi

    I have recently installed MySQL 3.23 on Windows 2000 Server.
    Can anyone tell me how do I change the root password and default port of MySQL?

  2. #2
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: how to change root password and port?

    Originally posted by aliweb
    Hi

    I have recently installed MySQL 3.23 on Windows 2000 Server.
    Can anyone tell me how do I change the root password and default port of MySQL?
    for changing root password:
    login to mysql as root and change database to "mysql".
    Then execute following query:
    update users set password=password('newpassword') where user = 'root';

    after execute this command execute following comand:
    flush privileges;

    Password for root is now changed.

    Change of deafult port can be done by editing of my.cnf file.
    Last edited by ika; 02-20-04 at 08:38.

  3. #3
    Join Date
    Feb 2004
    Posts
    1

    Re: how to change root password and port?

    Originally posted by ika
    for changing root password:
    login to mysql as root and change database to "mysql".
    Then execute following query:
    update users set password=password('newpassword') where user = 'root';

    after execute this command execute following comand:
    flush privileges;

    Password for root is now changed.

    Change of deafult port can be done by editing of my.cnf file.
    Thats some good information

    But maybe you could give me some advice here.

    I'm wanting a user (local system account) to be able to create databases without knowing or using root's password. is this possible?

    I also further wouldnt like that user to beable to look or touch the other databases that are running.

    thanks

  4. #4
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: how to change root password and port?

    Originally posted by doubleg_76
    Thats some good information

    But maybe you could give me some advice here.

    I'm wanting a user (local system account) to be able to create databases without knowing or using root's password. is this possible?

    I also further wouldnt like that user to beable to look or touch the other databases that are running.

    thanks
    I'm wanting a user (local system account) to be able to create databases without knowing or using root's password. is this possible?
    YES it is. It's all about privileges what you give to the user.
    More at documentation: http://www.mysql.com/doc/en/Privileges_provided.html

    I also further wouldnt like that user to beable to look or touch the other databases that are running.
    NO - this is actually not possible because MySQL doesn't support database links.

  5. #5
    Join Date
    Feb 2004
    Posts
    12

    Cool Re: how to change root password and port?

    Originally posted by ika
    for changing root password:
    login to mysql as root and change database to "mysql".
    Then execute following query:
    update users set password=password('newpassword') where user = 'root';

    after execute this command execute following comand:
    flush privileges;

    Password for root is now changed.

    Change of deafult port can be done by editing of my.cnf file.

    After changing the port to 61458 in the my.ini which is in my C:\WINNT folder, when I tried to connect to the MySQL using a clinet it says

    Host 'localhost' is not allowed to connect to this MySQL


    Plus what is the difference between defining a user and password in my.ini file and in the user table of mysql database. I ran your update statement to change the password and it worked fine but I have also seen that you can also define user and password in my.ini file. What is the use of it?

    There is some strange problem happened. Before changing port when I changed the password and connected it worked fine. But it was accepting the host as localhost and not my machine name. Following will give you the idea:

    Host: localhost
    user: root
    pass: asdf

    The above worked fine. But when I used this then it gave error.

    Host: ALIWEB (this is my machine name)
    user: root
    pass: asdf

    But when used the following it worked fine:

    Host: ALIWEB
    user: root
    pass:

    Why is that there are two different passwords for localhost and ALIWEB?
    Plus there are 2 root users and 2 % users in the user table of mysql database why?

  6. #6
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: how to change root password and port?

    Originally posted by aliweb
    After changing the port to 61458 in the my.ini which is in my C:\WINNT folder, when I tried to connect to the MySQL using a clinet it says

    Host 'localhost' is not allowed to connect to this MySQL


    Plus what is the difference between defining a user and password in my.ini file and in the user table of mysql database. I ran your update statement to change the password and it worked fine but I have also seen that you can also define user and password in my.ini file. What is the use of it?

    There is some strange problem happened. Before changing port when I changed the password and connected it worked fine. But it was accepting the host as localhost and not my machine name. Following will give you the idea:

    Host: localhost
    user: root
    pass: asdf

    The above worked fine. But when I used this then it gave error.

    Host: ALIWEB (this is my machine name)
    user: root
    pass: asdf

    But when used the following it worked fine:

    Host: ALIWEB
    user: root
    pass:

    Why is that there are two different passwords for localhost and ALIWEB?
    Plus there are 2 root users and 2 % users in the user table of mysql database why?
    try execute following query "select * from mysql.users;" and post the result of the query here. And I try to find problem...

Posting Permissions

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