I installed centos 6 as a webserver. It installed mysql. However, I guess I need mysql-server for me to use it for php and my website. I installed that.
I am unable to give root a password and can go no further. I have tried mysql-secure-installation and I just get stuck at errors and no progression. I have tried mysqladmin -u root password <password> and the accompanying one that includes the hostname.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
I am unable to use mysql with php or do anything at all with it. It was strange it installed mysql but I guess this version is different and needs more packages to work within a webserver.
all attempts at using mysql without mysql-server installed just results in nothing being found (like mysqld) and the like...so I had to install the server.
In 5.x I could just use mysqladmin and add roots, delete anonymous, etc. However, this time I am stuck.
I uninstalled mysql-server, the perl thing that comes with it, and mysql itself, then reinstalled them, that got me no where.
gotta be something I am missing here.
thanks for listening.
after a few yum remove / reinstalls I got this working by doing the following...
(not fully set up yet, just the very first step)
#yum install mysql mysql-server #service mysqld start #chkconfig --levels 235 mysqld on
#mysql --user=root -p (this is not the syntax I would have normaly used, but only this seemed to get past the hump) <entered a password when it asked me too> <ctrl-c out of mysql>
#mysql-secure-installation
it asked for password and I entered the new password. It then said, okay, and asked if I wanted to change the password, I did. (wanted a tough one).
then I finished the mysql-secure-installation questions.
Although secure-installation is set up to just hit enter on a new install as no password has yet been added, that results in an error 100% of the time. Using a different syntax mysql -u root password <new password> resulted in complete failure when trying the mysql-secure-installation.
Trying to by pass the secure installation and what I would assume was normal for adding the two root password commands (the one above and one with the hostname and password) resulted in failure (guess it is a new version with new stuff).
I am happy that mysql has finally automated that little 'wide open' mysql server thing. It was not smooth to do this though.
With a fresh install of mysql and the server the secureinstallation script should have took <enter> when I had no password. It does not (or not in my case)...wheee.
Bob Hoffman writes:
after a few yum remove / reinstalls I got this working by doing the following...
(not fully set up yet, just the very first step)
#yum install mysql mysql-server #service mysqld start #chkconfig --levels 235 mysqld on
#mysql --user=root -p
First time you log in you don't need "-p" as there is no password to input yet. That's your first mistake. "mysql -u root" would've worked just as good.
To avoid problems, after the install is done just execute mysql-secure-installation which will guide you through setting up the root password.
When you run into this kind of problems you can just remove or rename /var/lib/mysql and restart the service, it should "reset" you back to square one. Of course, make a backup first!
Cheerio
-- Nux! www.nux.ro
On 3 February 2012 07:22, nux@li.nux.ro wrote:
Bob Hoffman writes:
When you run into this kind of problems you can just remove or rename /var/lib/mysql and restart the service, it should "reset" you back to square one. Of course, make a backup first!
Sometimes you need to run mysql-db-install as well if you have del'd all of the /var/lib/mysql/ directory
mike
On 02/07/2012 11:52 AM, Michael Simpson wrote:
Sometimes you need to run mysql-db-install as well if you have del'd all of the /var/lib/mysql/ directory
the init scripts should take care of that, as long as there is no /var/lib/mysql present on the machine.