View Full Version : Running up MySQL 3.23.49 on FC1
IanWaring
2004-05-03, 04:08 PM CDT
I get the now well documented error on startup (fixed by changing the two ping commands in mysqld within /etc/init.d). I can see the mysqld daemon running okay.
However, i've never set the root password for MySQL - just installed FC1 then the php-mysql RPM. No matter what I do, I can't get beyond:
mysql -u root -pw
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
even before it prompts me for a password. No amount of mysqladmin nor mysql commands seem to budge this.
Any ideas how I get to set the password - or manage to get to a MySQL prompt successfully?
Ian W.
Bana
2004-05-03, 05:41 PM CDT
have you tried mysqladmin -u root password <teletubbies> ? http://dev.mysql.com/doc/mysql/en/mysqladmin.html
IanWaring
2004-05-04, 12:35 AM CDT
cd /usr/bin
./mysqladmin -u root -password mypasswordhere
./mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'
:-(
Ian W.
IanWaring
2004-05-04, 04:12 AM CDT
removing MySQL and all it's dependencies (mysql-server, mysql-devel,php-mysql and one other), then YUM install them all again.
Same error message!
I've got nothing loaded yet - so any guidelines to reset the grants table from scratch may also help!
Ian W.
IanWaring
2004-05-04, 06:00 AM CDT
One of the things I didn't do in the early days was setting 127.0.0.1 to alias localhost in /etc/hosts (shouldn't this be a default in there?).
I tried mysql -h server.minsystems.co.uk -u root -pw ... entered the password and I have an MySQL prompt.
I still can't get it to let me in without the hostname specified (it refuses to talk to root@localhost), but at least I now have a longhand way in... until I suss out how to enable that route in too.
Ian W.
IanWaring
2004-05-05, 10:27 AM CDT
Any ideas where the physical data held in a mysql database (not just the indices) resides?
As I have PHP sitting on top, I didn't want to replace my MySQL install with the more up to date releases, so I went back to first principles.
First, I fixed my network setup to have localhost defined as 127.0.0.1
Then I deleted all the files in /var/lib/mysql... directories, then ran another mysql_install_db to start afresh. Or so I thought!
Good news - I can now use mysqladmin to create the first user and can login to MySQL without having to specify the host explicitly. However, while MySQL allowed me to create all my old databases, it wouldn't accept any grants (this is how I set up a spoof "webuser" with a password - which my PHP scripts use - which I apply with limited permissions on a per table basis). Just kept on coming back with 0 rows affected every time I try.
So, I tried connecting to the MySQL database itself - and got an error indicating insufficient access rights to access ".mysql". This directory seems to have root ownership, so i've chown'd this to mysql:mysql instead. However, it's still not accepting any grants... I still get zero records affected and an inability to login with the specified username/password.
One thought though - when I did the restore of the dump from my old system yesterday, it put back all the user accounts from my old system - some of which mention it's old server name. Removing then reinstalling mysql, mysql-server and mysql-devel, then doing the mysql_install-db again would, I thought, start my completely afresh. However, it still has all the databases all populated - including the old mysql user tables! Obviously, the data must hide somewhere that I didn't delete, and the fresh installs just found the data files again.
Any ideas where the physical data held in a mysql database resides? I guess reinstalling everything after removing that would go a long way to me fixing this thing once and for all. Any ideas?
Ian W.
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.