Koozali.org: home of the SME Server

mysql update - help !!!!

tanyu

mysql update - help !!!!
« on: November 20, 2004, 12:31:50 AM »
I used the script in : http://mirror.contribs.org/smeserver/contribs/dmusty/SME6.0/scripts/
and it completely fucked up my mysql database : I noticed, but too late, that one of the files that was to be downloaded by the script pointed to a 404 error.. now it has modified the root account in mysql database and I've spent the las 4 hours to try to fix it without any success..
I downloaded the lastes stable 4.1.7 rpms, updated with them.. launched the fix_privileges script as well.. does strictly nothing..

I tried this :
- service mysqld stop
- safe_mysqld --skip-grant-tables &
- mysql -h localhost mysql
  then :
   - update user set password=password('new_password') where user='root';
   - flush privileges;
   - exit;
- service mysqld stop
- service mysqld start
and all I get when i try a 'mysal -u root -p 'new_password' is :
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

So I looked at all the hints I found on the net and tried this :
- service mysqld stop
- safe_mysqld --skip-grant-tables &
- mysql -h localhost mysql
then :
  - Grant all on * to root@localhost identified by '1234';
and I get :
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

(although this is the method which is supposed to be used on the mysql.org webserver...)

So I'm completely stuck... what can I do to delete this darned password which comes from nowhere ???

Please.. heeeeeelp!!!! I've a lot of thinhs on this server and I'd really like to avoid reinstalling...





 :hammer:

guest22

mysql update - help !!!!
« Reply #1 on: November 20, 2004, 07:55:38 AM »
Hi,

try this: http://no.longer.valid/phpwiki/index.php?pagename=How%20to%20change%20the%20MySQL%20root%20password%20in%20SME%20Server%205.1.2

It popped up after 1 search with keywords 'mysql password' ;-)

RequestedDeletion

tanyu

mysql update - help !!!!
« Reply #2 on: November 20, 2004, 08:56:07 AM »
hello!
I did it..
Here is what I get :
[root@webserver root]# /etc/rc.d/init.d/mysqld stop
Killing mysqld with pid 5185
Wait for mysqld to exit. done
[root@webserver root]# /etc/e-smith/events/actions/conf-mysql-password
041120  9:58:42 [Warning] Asked for 196608 thread stack, but got 126976
[root@webserver root]# /etc/rc.d/init.d/mysqld start
[root@webserver root]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@webserver root]#

Really wonder what was messed up with this script ...

Any help greatly appreciated...

tanyu

mysql update - help !!!!
« Reply #3 on: November 20, 2004, 10:05:36 AM »
p.s: what stuns me the more is that there ARE two root users in the user table (I checked with a windows tool under grant-restricted mode) one on localhost, another on '%', both with all privileges...both without password... And I keep on being rejected from wherever I come in normal mode..

Gasp.. is there no way to regenerate completely a blank mysql database set to restart with a clean an correct mysql server ? (I'll dump my bases in grant-restricted mode and regenerate them later if needed..)

Thanks for any help..

Offline wyron

  • *
  • 275
  • +0/-0
    • http://www.ideast.dk
mysql update - help !!!!
« Reply #4 on: November 21, 2004, 07:46:19 AM »
Well, you're not alone!
I have exactly the problem you describe since installing a new 6.01-01.
Mysql is actually working, so I haven't done much about it yet, except following what I could find with a search, including RequestedDeletion's suggestion. The result was exactly as you describe it.
I tried mailing Dan Brown, though (my personal candidate for guru-status concerning mysql and the horde framework), but he hasn't answered me, so I'll be following this thread closely instead!
Greetings
wyron
...

ergozd

mysql update - help !!!!
« Reply #5 on: November 21, 2004, 07:35:15 PM »
Let's see if I can offer any help to you guys...

1 - MySQL root password is stored in /root/.my.cnf and it should have the correct (VERY LONG) password so you can simply access mysql
2 - MySQL config file is stored in /etc/my.cnf
3 - Have you tried to uninstalling your v4.1.7 MySQL RPMS and install v4.0.21 RPMS
4 - If you knew all this you will have to give me some more information. Check your /var/log/mysqld.log and /var/log/messages

Best rgds, Ergin

tanyu

mysql update - help !!!!
« Reply #6 on: November 22, 2004, 12:08:40 AM »
Well I finally gave up..
After an attempt to update to 6.01 which was even worse..
I backed up my databases and ebays, reinstalled a fresh 6.01 and upddated it with jasper vanhees scripts ( I have to have a more recent php and mysql release in order to run sucgarcrm), and everything gets well..
Dunno what happened with the first mysql update, but I gather it was because there was a broken link in a wget that f..ed up all the rest..
At least it works now.. ;-)

Cheers,
Phil.

 :pint:

Offline wellsi

  • *
  • 475
  • +0/-0
    • http://www.wellsi.com
mysql update - help !!!!
« Reply #7 on: November 22, 2004, 07:45:09 PM »
It would be worth the upgrade scripts checking that the files exist before continuing. I just had a panic as my PHP scripts didn't work today. It turns out this was due to upgrading to MySQL 4.

It appears that MySQL-4.0/MySQL-shared-compat-4.0.20-0.i386.rpm was missing, trying wget again gave a 404.

I then found a copy at
http://mirror.contribs.org/smeserver/contribs/cgenner/RPMS/i386/

then all was OK.

I don't really want to complain about the upgrade scripts that are provided as they are very useful - but if us 'dumb users' don't check for errors it can be hard later to work out what went wrong.

So Thanks to Ergin for your 4.0.21 script it worked but I failed to spot the 404.
............

ergozd

mysql update - help !!!!
« Reply #8 on: November 22, 2004, 08:18:35 PM »
Thanx wellsi!

I modified the script so that it downloads existing file... :-)

PS : MySQL-shared-compat 4.0.21 was released couple weeks after other MySQL RPMS so the script gets and install v4.0.20 which works (or worked) fine... I simply have not checked that after the latest production release v4.0.22 the older versions are deleted.

Best rgds, Ergin

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
mysql update - help !!!!
« Reply #9 on: November 30, 2004, 02:13:27 AM »