Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Error connecting to database
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
DancesWithWords
Guru
Guru


Joined: 29 Jun 2002
Posts: 347
Location: ottawa, canada

PostPosted: Sun Dec 16, 2007 2:39 am    Post subject: Error connecting to database Reply with quote

Okay the long and short of this problem started when I stupid did an emerge -up world. For the most part all went well (okay not the apache part that is another post, lol), but I ended up with an mysql that seem not to only be access able by command line. So my Wordpress, gallery2, firestates can't connect to there respective databases, however Amarok is still able to connect to its database. The only difference b/t them seems to be that the first 3 are web base apps and that later is a compiled program. I've got phpmyadmin installed all 3 appears to have the same permissions. That is all the info I've got to give at this time.

All help will be greatly appreciated.

--
DWW
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1696

PostPosted: Sun Dec 16, 2007 8:30 am    Post subject: Reply with quote

I dont know if you looked at http://www.gentoo.org/doc/en/mysql-upgrading.xml
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
DancesWithWords
Guru
Guru


Joined: 29 Jun 2002
Posts: 347
Location: ottawa, canada

PostPosted: Sun Dec 16, 2007 10:25 pm    Post subject: Reply with quote

turtles wrote:
I dont know if you looked at http://www.gentoo.org/doc/en/mysql-upgrading.xml


So my result from the very first line of the mysql update page...


quickpkg dev-db/mysql
* No write access to '/usr/portage/packages'


Good start no?? ;-)

Oh... yes I did run this as root.

--
DWW
Back to top
View user's profile Send private message
gimpel
Advocate
Advocate


Joined: 15 Oct 2004
Posts: 2720
Location: Munich, Bavaria

PostPosted: Sun Dec 16, 2007 10:29 pm    Post subject: Reply with quote

That's somewhat a bug in quickpkg
Code:
mkdir /usr/portage/packages

_________________
http://proaudio.tuxfamily.org/wiki - pro-audio software overlay
Back to top
View user's profile Send private message
DancesWithWords
Guru
Guru


Joined: 29 Jun 2002
Posts: 347
Location: ottawa, canada

PostPosted: Mon Dec 17, 2007 5:30 pm    Post subject: Reply with quote

gimpel wrote:
That's somewhat a bug in quickpkg
Code:
mkdir /usr/portage/packages


Okay this fixed this issue.

I decided to walk through the upgrade process. It was going well until I get this point and below is the error.


bbox ~ # mysql_upgrade_shell --user=root --password='PASSWORD' \ --protocol=tcp --verbose --datadir="${DATADIR}"
Running /usr/bin/mysqlcheck --password=PASSWORD --protocol=tcp --check-upgrade --all-databases --auto-repair --user=root
You should give only options, no arguments at all, with option
--all-databases. Please see /usr/bin/mysqlcheck --help for more information.
This script updates all the mysql privilege tables to be usable by
the current version of MySQL

Got a failure from command:
cat /usr/share/mysql/mysql_fix_privilege_tables.sql | /usr/bin/mysql --no-defaults --force --user=root --host=localhost --database=mysql
Please check the above output and try again.

Running the script with the --verbose option may give you some information
of what went wrong.

If you get an 'Access denied' error, you should run this script again and
give the MySQL root user password as an argument with the --password= option


--
DWW
Back to top
View user's profile Send private message
DancesWithWords
Guru
Guru


Joined: 29 Jun 2002
Posts: 347
Location: ottawa, canada

PostPosted: Sat Dec 29, 2007 8:54 pm    Post subject: Reply with quote

DancesWithWords wrote:
gimpel wrote:
That's somewhat a bug in quickpkg
Code:
mkdir /usr/portage/packages


Okay this fixed this issue.

I decided to walk through the upgrade process. It was going well until I get this point and below is the error.


bbox ~ # mysql_upgrade_shell --user=root --password='PASSWORD' \ --protocol=tcp --verbose --datadir="${DATADIR}"
Running /usr/bin/mysqlcheck --password=PASSWORD --protocol=tcp --check-upgrade --all-databases --auto-repair --user=root
You should give only options, no arguments at all, with option
--all-databases. Please see /usr/bin/mysqlcheck --help for more information.
This script updates all the mysql privilege tables to be usable by
the current version of MySQL

Got a failure from command:
cat /usr/share/mysql/mysql_fix_privilege_tables.sql | /usr/bin/mysql --no-defaults --force --user=root --host=localhost --database=mysql
Please check the above output and try again.

Running the script with the --verbose option may give you some information
of what went wrong.

If you get an 'Access denied' error, you should run this script again and
give the MySQL root user password as an argument with the --password= option


--
DWW


Bump
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1696

PostPosted: Mon Dec 31, 2007 7:02 pm    Post subject: Reply with quote

I go out of my way to only use postgresql so I only have to be bad at 1 database.
So you are at the last step of code listing 1.1. Still working in your old version of Mysql?
Code:
mysql_upgrade_shell --user=root --password='your_password' \
     --protocol=tcp --datadir="${DATADIR}"

lets see you are in the first shell again. Maybe you are trying all this in the new version?
What version were you at /upgrading from?
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
DancesWithWords
Guru
Guru


Joined: 29 Jun 2002
Posts: 347
Location: ottawa, canada

PostPosted: Wed Jan 02, 2008 7:23 pm    Post subject: Reply with quote

turtles wrote:
I go out of my way to only use postgresql so I only have to be bad at 1 database.
So you are at the last step of code listing 1.1. Still working in your old version of Mysql?
Code:
mysql_upgrade_shell --user=root --password='your_password' \
     --protocol=tcp --datadir="${DATADIR}"

lets see you are in the first shell again. Maybe you are trying all this in the new version?
What version were you at /upgrading from?


Great someone finally answers. Xmas Holidays is always a bad time to have serious troubles.

Okay latest info is:

mysql Ver 14.12 Distrib 5.0.44, for pc-linux-gnu (x86_64) using readline 5.2

I don't remember what the earlier version was that I upgraded from and I've un-installed and installed a bunuch of times trying to sort this issue out that I could remember it even if I wanted to. :-( If I don't sort this out soon I'm going to delete to whole f$%k thing lose all my data and start from scratch. Not a prospect I relish. Then again the idea I might have to read another 100 pages of website does not look anymore fun. This seems like the longest I've ever had to deal with problem on any Linux box in years.


I appreciate any help that you can offer.

--
DWW
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1696

PostPosted: Thu Jan 03, 2008 2:35 am    Post subject: Reply with quote

I install all my server apps on my laptop make copys of my databases on my laptop and try all my upgrades there first. I dont use my laptop as a bin host yet although I am looking into this. The problem is different arches and customizations.
A better approach would be to keep a Gentoo stable partition on the laptop along side a testing partition.
A really paranoid approach would be to have a testing partition on the server too. My servers are so old I just get extra ones given to me.
I am a big fan of glep 42 which would warn you or have the option of warning you before emerging packages that require a guide or reading a 18 page expat post to get a working system again.
Like how janitors put the "wet floor" sign before the slippery spot on the floor. Come to think of it I am going to update my tag line.
AND is it me or is code listing 1.1 in that guide like 4 steps for one code listing. They need to be broken up. Could file a bug about it. all this will not fix your problem
SO

Back to fixing your problem.
You were trying to upgrade from 5.0 to 5.0
You need to quickpackage the current version and unmerge it. Then re emerge the old version you see in your log.
Someone check me on this but I think something like this:
Code:
quickpkg dev-db/mysql && emerge -C =dev-db/mysql-5.0.44-r2

Or just emerge --sync and see if there is a newer version already and emerge that when you get to that step.
then when it you get to the emerging 5.0 step in code listing 1.1 just grab the package.

then
Code:
grep 'mysql' /var/log/emerge.log

should tell what version you were running.
then re-emerge it.
If it was really old as in <4.0.24
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
DancesWithWords
Guru
Guru


Joined: 29 Jun 2002
Posts: 347
Location: ottawa, canada

PostPosted: Thu Jan 03, 2008 7:19 pm    Post subject: Reply with quote

turtles wrote:
I install all my server apps on my laptop make copys of my databases on my laptop and try all my upgrades there first. I dont use my laptop as a bin host yet although I am looking into this. The problem is different arches and customizations.
A better approach would be to keep a Gentoo stable partition on the laptop along side a testing partition.
A really paranoid approach would be to have a testing partition on the server too. My servers are so old I just get extra ones given to me.
I am a big fan of glep 42 which would warn you or have the option of warning you before emerging packages that require a guide or reading a 18 page expat post to get a working system again.
Like how janitors put the "wet floor" sign before the slippery spot on the floor. Come to think of it I am going to update my tag line.
AND is it me or is code listing 1.1 in that guide like 4 steps for one code listing. They need to be broken up. Could file a bug about it. all this will not fix your problem
SO

Back to fixing your problem.
You were trying to upgrade from 5.0 to 5.0
You need to quickpackage the current version and unmerge it. Then re emerge the old version you see in your log.
Someone check me on this but I think something like this:
Code:
quickpkg dev-db/mysql && emerge -C =dev-db/mysql-5.0.44-r2

Or just emerge --sync and see if there is a newer version already and emerge that when you get to that step.
then when it you get to the emerging 5.0 step in code listing 1.1 just grab the package.

then
Code:
grep 'mysql' /var/log/emerge.log

should tell what version you were running.
then re-emerge it.
If it was really old as in <4.0.24


Okay, I've un-installed mysql and now re-installing.

--
DWW
Back to top
View user's profile Send private message
DancesWithWords
Guru
Guru


Joined: 29 Jun 2002
Posts: 347
Location: ottawa, canada

PostPosted: Mon Jan 07, 2008 4:28 pm    Post subject: Reply with quote

turtles wrote:
I install all my server apps on my laptop make copys of my databases on my laptop and try all my upgrades there first. I dont use my laptop as a bin host yet although I am looking into this. The problem is different arches and customizations.
A better approach would be to keep a Gentoo stable partition on the laptop along side a testing partition.
A really paranoid approach would be to have a testing partition on the server too. My servers are so old I just get extra ones given to me.
I am a big fan of glep 42



Dumb question how do you use this.

I installed glep42

so I use...

eselect set glep42 ??

--
DWW
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1696

PostPosted: Mon Jan 07, 2008 7:09 pm    Post subject: Reply with quote

what do you mean you installed it?
Edit: oh yeah there is a masked package app-admin/eselect-news
had to unmask eselect and eselect-news.
Now I get
Code:
eselect news list
Unread news items:
  (none found)
Read news items:
  (none found)

Now that it is installed maybe I will get news Items.
Well this is OT

Did you get mysql updated?
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
DancesWithWords
Guru
Guru


Joined: 29 Jun 2002
Posts: 347
Location: ottawa, canada

PostPosted: Mon Jan 07, 2008 8:51 pm    Post subject: Reply with quote

turtles wrote:
what do you mean you installed it?
Edit: oh yeah there is a masked package app-admin/eselect-news
had to unmask eselect and eselect-news.
Now I get
Code:
eselect news list
Unread news items:
  (none found)
Read news items:
  (none found)

Now that it is installed maybe I will get news Items.
Well this is OT

Did you get mysql updated?


Nope and I've lost all hope... I just can't seem to sort it out. Tonight I'll probably rm -rf the whole thing, lose the data :-( and start from scratch.

--
DWW
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1696

PostPosted: Mon Jan 07, 2008 9:55 pm    Post subject: Reply with quote

How far did you get with the update?
BTW I am going to start another thread for app-admin/eselect-news
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
jonnevers
Veteran
Veteran


Joined: 02 Jan 2003
Posts: 1594
Location: Gentoo64 land

PostPosted: Mon Jan 07, 2008 11:17 pm    Post subject: Reply with quote

okay. sorry if this is a stupid question.

is mysql only binding to the localhost after the update? I vaguely remember mysql being misconfigured after a recent upgrade (even got past me in the conf file update part) and I think somehow the binding ip line was removed and so it only tried to bind to the localhost... i.e. terminal access but not from webapps using it's external ethernet ip .

when mysql is running:
Code:
nmap -p0-65535 you.ip.address.here

see if 3306 is open on the address your webapps use.
Back to top
View user's profile Send private message
DancesWithWords
Guru
Guru


Joined: 29 Jun 2002
Posts: 347
Location: ottawa, canada

PostPosted: Tue Jan 08, 2008 3:17 am    Post subject: Reply with quote

turtles wrote:
How far did you get with the update?
BTW I am going to start another thread for app-admin/eselect-news


Well I didn't get to nuking my mysql yet been busy doing other stuff.
This is as far as I got.

===================================================
Code:
quickpkg dev-db/mysql && emerge -C =dev-db/mysql-5.0.44-r2

Or just emerge --sync and see if there is a newer version already and emerge that when you get to that step.
then when it you get to the emerging 5.0 step in code listing 1.1 just grab the package.

then
Code:
grep 'mysql' /var/log/emerge.log
===================================================

--
DWW
Back to top
View user's profile Send private message
DancesWithWords
Guru
Guru


Joined: 29 Jun 2002
Posts: 347
Location: ottawa, canada

PostPosted: Tue Jan 08, 2008 3:22 am    Post subject: Reply with quote

jonnevers wrote:
okay. sorry if this is a stupid question.

is mysql only binding to the localhost after the update? I vaguely remember mysql being misconfigured after a recent upgrade (even got past me in the conf file update part) and I think somehow the binding ip line was removed and so it only tried to bind to the localhost... i.e. terminal access but not from webapps using it's external ethernet ip .

when mysql is running:
Code:
nmap -p0-65535 you.ip.address.here

see if 3306 is open on the address your webapps use.


here are my results for the above.


======================================================
tarting Nmap 4.20 ( http://insecure.org ) at 2008-01-07 22:11 EST
Interesting ports on localhost (127.0.0.1):
Not shown: 65528 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
139/tcp open netbios-ssn
445/tcp open microsoft-ds
631/tcp open ipp
3306/tcp open mysql
8010/tcp open unknown
31416/tcp open boinc-client

Nmap finished: 1 IP address (1 host up) scanned in 1.657 seconds
=======================================================

--
DWW
Back to top
View user's profile Send private message
jonnevers
Veteran
Veteran


Joined: 02 Jan 2003
Posts: 1594
Location: Gentoo64 land

PostPosted: Tue Jan 08, 2008 6:05 am    Post subject: Reply with quote

what about the interface(s) in the system that aren't local host? (i.e. eth0)
Back to top
View user's profile Send private message
DancesWithWords
Guru
Guru


Joined: 29 Jun 2002
Posts: 347
Location: ottawa, canada

PostPosted: Wed Jan 09, 2008 12:10 am    Post subject: Reply with quote

jonnevers wrote:
what about the interface(s) in the system that aren't local host? (i.e. eth0)


I'm not familiar with the usuage of eth0 what should the command string look like?

--
DWW
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum