If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > how to change root password and port?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-20-04, 06:22
aliweb aliweb is offline
Registered User
 
Join Date: Feb 2004
Posts: 12
Cool 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?
Reply With Quote
  #2 (permalink)  
Old 02-20-04, 07:30
ika ika is offline
Registered User
 
Join Date: Oct 2003
Location: Slovakia
Posts: 482
Re: how to change root password and port?

Quote:
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 07:38.
Reply With Quote
  #3 (permalink)  
Old 02-20-04, 08:12
doubleg_76 doubleg_76 is offline
Registered User
 
Join Date: Feb 2004
Posts: 1
Re: how to change root password and port?

Quote:
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
Reply With Quote
  #4 (permalink)  
Old 02-20-04, 08:48
ika ika is offline
Registered User
 
Join Date: Oct 2003
Location: Slovakia
Posts: 482
Re: how to change root password and port?

Quote:
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.
Reply With Quote
  #5 (permalink)  
Old 02-20-04, 08:56
aliweb aliweb is offline
Registered User
 
Join Date: Feb 2004
Posts: 12
Cool Re: how to change root password and port?

Quote:
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?
Reply With Quote
  #6 (permalink)  
Old 02-20-04, 12:07
ika ika is offline
Registered User
 
Join Date: Oct 2003
Location: Slovakia
Posts: 482
Re: how to change root password and port?

Quote:
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...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On