Solved

MySQL 5.0.45 - root access on any external, no pass ?

Posted on 2007-11-18
20
1,174 Views
Last Modified: 2010-04-21
Hello everyone

I have read every thread i could find and tried every command i can, i am sure i am doing something wrong or lack of sleep has fried my brain.

brand new 5.0.45 MySQl install, i need to allow access on root from all hosts with no password

i cant get it to work, i can only connect from local host on root...

i tried adding *.* as a host using mysql admin but it seems to do nothing and doesnt allow me to connect from another system

i have tried grant commands, giving grant to root,flush privileges afterwards, but nothing is working for me, this is a test bed system, not accessible from the Inet, i am redoing someone else's work who has no security so for now i need just root access with no password from *.* anywhere.....

Please save what little sannity i have left, i know the question has been asked, but i have tried literally ever response people have given to everyone else :(
0
Comment
Question by:Mathiau
  • 13
  • 4
  • 3
20 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20308868
well, let me tell you ROOT with no password for any host is like serving it on the golden plate to hackers...
DON'T do that... it will save you from more severe illness later!!!

why ROOT?
why no password?

0
 
LVL 18

Expert Comment

by:Andrej Pirman
ID: 20308928
First of all, like Angellll says: root with NO password is ...I even do not have an idea how to call such approach!

But if you still want to grant access to all hosts, put "%" instead of "localhost" in Host row of mysql table, and reload privileges.
0
 
LVL 2

Author Comment

by:Mathiau
ID: 20308930
I know it is, why this system isnt accessible to the internet right now, i am well aware of the security issued involved.

the original coder claimed passwords didnt work with his scripts, i have tested some, and some work and some dont, this person also uses global variables (using php with mysql).

So i am just trying to move what i need to a new server, once done, i plan to go back over the coding and fix it so it works with user and passwords, these items wont be seeing the light of day, or the internet, until they are password protected.
0
 
LVL 18

Expert Comment

by:Andrej Pirman
ID: 20308932
...also, assure firewall is not blocking traffic on port 3306, which is used by MySQL server.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20308936
>the original coder claimed passwords didnt work with his scripts, i
actually, with PHP, having no password will not work, you will have to use a password anyhow.
0
 
LVL 2

Author Comment

by:Mathiau
ID: 20308979
not sure, cause non of his php scripts have password to connect to the mysql DB's and his pages work, not a single one! scary how he got by for 4 years doing this, using root with no passwords to connect tot he DB's, not even IP access was used.


example


$use=$PHP_AUTH_USER;
      $dblink=mysql_connect("**********", "root", "");
      $db_list = mysql_list_dbs($dblink);
            while ($database=mysql_fetch_object($db_list))


all his scripts are like that.
0
 
LVL 2

Author Comment

by:Mathiau
ID: 20309002
Just tried this

grant all privileges on *.* to 'root'@'%';


but now i get the

"Can't find any matching row in the user table"
0
 
LVL 2

Author Comment

by:Mathiau
ID: 20309014
angelIII, could i tbe because of using version of PHP 4 and lower? i know after 4.1? global variables was off by default and other security items changed to make it more out of the gate secure.


0
 
LVL 18

Accepted Solution

by:
Andrej Pirman earned 500 total points
ID: 20309605
It is:
GRANT ALL ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;
or
REVOKE ALL ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;
0
 
LVL 2

Author Comment

by:Mathiau
ID: 20310359
i am still getting the error

Can't find any matching row in the user table

running the GRANT ALL ON *.* TO 'root'@'%';

i am conencting using mySQL Query Browser and then connecting to the mysql folder locally on the machine which the BD is hosted on... am i doing something incorrectly? or is their some restriction on mysql 5.0.45 that wont allow me to grant this access to root?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20310449
>angelIII, could i tbe because of using version of PHP 4 and lower?
yes, that is highly probable!

now, please run this:

mysql> use mysql
mysql> select user, hostname, password from user

and report that it returns (clearing the passwords anyhow).
0
 
LVL 2

Author Comment

by:Mathiau
ID: 20310466
just did a completly reinstall of MySQL, no passwords on root, standard install (still get same error with grant)
 
results from select * from users  ( added the ...)

Host.................................User      ..........................Password
localhost..........................root      
production.......................root      
127.0.0.1.........................root      


0
 
LVL 2

Author Comment

by:Mathiau
ID: 20312524
there are no passwords set also, why they are blank.
0
 
LVL 2

Author Comment

by:Mathiau
ID: 20314832
is it posible i may need to put a password on root before i can allow external access, and if so, can i remove the password after it was been added?
0
 
LVL 2

Author Comment

by:Mathiau
ID: 20317441
didnt work with a password on the root account either, now i am completly lost on this one :( Did MySQL completly block in the program root access on *.* in some new version
0
 
LVL 2

Author Comment

by:Mathiau
ID: 20317762
Did i get everyone stumped on ths as well :)
0
 
LVL 2

Author Comment

by:Mathiau
ID: 20322331
Well, it seems to make this work, this method worked


Put a password on the root account / Apply
Add Hosts from which the user can connect   (*.*)
remove password from root account / apply


done, can now access externally from any host, i did this using MySQL Admin.
0
 
LVL 2

Author Closing Comment

by:Mathiau
ID: 31409830
The solution was correct, but did not seem to apply perfectly to this situation, perhaps this is a new limitation in MySQL 5.0.45 + that you can not give such access with out root having at least a password to start, which is good news of course.
0
 
LVL 18

Expert Comment

by:Andrej Pirman
ID: 20326695
I am glad you solved it. MySQL admin tool can be used for such things, too.
0
 
LVL 2

Author Comment

by:Mathiau
ID: 20363349
this is weird, set up another system and tried the above but it is not working..lol so maybe it was a combo of what i did and some queries, time to test!
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now