You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Saimon Moore <sa...@yahoo.co.uk> on 2002/04/04 00:24:42 UTC

torque + mysql accident

I've been using torque recently and I've just had a bit of an accident.

I have now recovered from the accident so I thought i'd describe my 
experience  to the list so that others could avoid my mistakes.

I use mysql as my database and I was running 'ant init' to generate my 
OM. You should set up the databaseUrl and createDatabaseUrl properties 
in build.properties such that:

databaseUrl = jdbc:mysql://localhost:3306/${database.name}
createDatabaseUrl = jdbc:mysql://localhost:3306/${database}

In my rush to get going I accidentally reversed the above property values.

'ant init' failed complaining about how the db server was refusing the 
connection. After a lot of investigating (look in the 
/var/lib/mysql/mysql dir),  I realised that the ant task had 
inadvertantly created my db on top of the mysql system db. (Just my luck 
that one of my tables was also 'user' a system table in mysql). The 
reason that this was able to happen was because the db user I was using 
was a superuser that had all privileges.

Basically, I couldn't connect to the db any which way I tried because it 
didn't have it's user table to allow connections.

After a lot of searching, the mysql manual and the net, i finally found 
a way to regenerate the original mysql system tables. You need to delete 
all files in the mysql data directory (/var/lib/mysql/mysql) and then 
you need to execute 'mysql_install_db' script. This restored the 
original root user and from that I was able to create my original user 
and succesfully complete the OM creation.

P.S. You need to execute the 'mysql_install_db' script as root so if 
mysql is started as a service in linux don't forget to change the 
ownership of the mysql system files to mysql:daemon otherwise it won't 
startup. (it complains about not finding the mysql.sock socket etc...)

Well, I hope that will help somebody to avoid the same stupid mistake. 
(it took me a good three hours to figure all that out ;)

Moral: don't use mysql superuser's with torque.



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: torque + mysql accident

Posted by Jason van Zyl <jv...@zenplex.com>.
On Wed, 2002-04-03 at 17:24, Saimon Moore wrote:
> I've been using torque recently and I've just had a bit of an accident.
> 

Torque mailing list.

-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://tambora.zenplex.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>