Access denied for user 'root' @ ' localhost ' (Using password : NO ) #tried YES
-
@ciranodd Usually the MySQL root user has full access rights if you don’t actively restrict (I am sure you didn’t). As I can see in the .fogsettings file there is a password set. But from the screenshot we see that no password was used to connect to the DB. Have you re-run the installer after setting the password in .fogsettings? Please check
/var/www/html/fog/lib/fog/config.class.php
to see if the settings match! As well try to connect to your DB via the MySQL command line client to see if the DB is running and connection data is correct:mysql --user=root -p
(try mysql commandshow databases;
for example andexit
to close) -
Again gents thanks !!!
I am down to GRANT root USER the right privileges I THINK !!!
Also i ran into a problem when running what you suggested mysql --user=root -p (Please see attachment fixed ) hopefully it helps someone else.
Just for convenience i install Webmin !!!
0_1458766852050_ERROR 2002 (HY000)-FOG SERVER MYSQL FIX.txt
I still can’t grant the right privileges to root user for localhost. I tried even running mysql install again (keeping the same mysql root pass i’ve been using )but nothing.
-
@ciranodd At this point, you haven’t done, gained, or lost anythign.
Why not completely remove mysql/mariad and reinstall??
sudo apt-get --purge mysql* rm -rf /var/lib/mysql sudo apt-get install mysql mysql-server
Of course if you have data to backup, backup first?
-
@ciranodd You might be running into this old and know ubuntu mysql issue: https://github.com/fogproject/fogproject/issues/1
I wonder why root@localhost only has “select table data” permission according to what we see in webmin… I am sure someone modified the DB. Probably Tom’s suggestion on removing the DB and starting from scratch is not bad I suppose.
-
I’ll try his suggestion !!
-
!!! SUCCESS !!!
Hi Tom,
this is a fresh install, i have another Fog server fully functional. I am just trying to do another one from zero. NO need to backup anything.!!!
i had a an error running sudo apt-get --purge mysql* so i tried
apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
rm -rf /etc/mysql /var/lib/mysql
apt-get autoremove
apt-get autoclean
then i ran
#apt-get install mysql-server
then check the Privileges and still root@localhost still has “select table data” only !!!
i tried resetting MYSQL - Got an error…
Well a good completed restart of my Ubuntu box will not hurt.I tried checking the privileges but i couldn’t log in to MYSQL !!!
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
Thankfully i had that problem before and from my notes i fixed it (the file i sent you guys before ERROR 2002)
reset MYSQL
/etc/init.d/mysql restart
AND NOW I DO HAVE ----- GRANT_PRIVI ---- for root@localhost
Oh man !!!
Not sure what happened, but i had to remove the mysql which i thoght i had done a couple of times but i wasn’t doing it right than do a manual install mysql server
It was never fog it was MYSQL
Thanks a lot guys !!! Hope this helps someone in the future !!!
-
@ciranodd I don’t understand why you are having so many problems. With Ubuntu, After Ubuntu is installed, you just checkout a copy of fog trunk and then run the installer. that’s it.
-
@Wayne-Workman
Hey Wayne !!!That’s exactly what i though !!! But it was never FOG it was MYSQL that somehow wast not giving the right privileges to the root user for localhost
I am able to load the WEB GUI !!! Now i am going to start playing with it !!!
-
Hi,
@Wayne-Workman @ciranodd we have the same issue too on Debian 8. No Mysql (fresh install), just installed with FOG trunk. If we don’t put a MySQL password (empty password) at the install, there are no problems. If we put a password, the error “Access denied for user ‘root’ @ ’ localhost ’ (Using password : NO ) #tried YES” occurs when we want to install/upgrade database (same on the capture from ciranodd).
Or else, if password put, we have to change manually rights for root account on mysql.
-
@MagicLink A database password for the root user must be setup by you or the administrator for there to BE a password set in the first place.
In older times, Ubuntu/Debian would ask you to supply a password, but I removed this requirement because redhat variants never gave this opportunity during the installation process. In trying to commonize the functions, I was able to get mysql to be installed in much the same methodology as Redhat based OS’s under Debian/Ubuntu variants.
When it asks you for the password, it asks you “Did you set a password for mysql?” It is not the opportunity for you to set one.
This is to be expected.
-
@MagicLink I’ll check this out tomorrow on the RedHat side and see what happens.
-
Hi Guys,
Didn’t wanted to bother anyone again since we solved the problem. But indeed as @MagicLink said when entering a password during fog installation gave me the issue again (I had to prepared a backed server in case this one goes bad), however all i had to do was make sure MYSQL was running correctly (ran into the same problem, but i had a fixed !!!) 0_1459315888568_ERROR 2002 (HY000)-FOG SERVER MYSQL FIX.txt
Then make sure that the both configuration files match the inf you entered during the installation
/var/www/html/fog/lib/fog/config.class.php
/opt/fog/.fogsettings
and DONE.ps,
Not sure what i did wrong but when i re-ran the install the LOCALHOST in the config file /var/www/html/fog/lib/fog/config.class.php was changed to the IP i gave my server instead of the “localhost”
Just change changed it to “localhost” and DONE !!!
Lesson !!!
Always make sure your config file is setup correctly !!!
Regards Gents !!!