Forums / Install & configuration / Fatal error: A database...

Fatal error: A database...

Author Message

maarten velde

Tuesday 26 February 2008 1:07:13 pm

Hey People,

I'm new to this forum. I couldn't find another topic considering this problem in the forum, I hope I'm right in starting a new topic on this problem.

eZ Publishing looks realy promisng, and I try to install it on my own server, but when installing I get the following error at the very last step:

<i>Fatal error: A database transaction in eZ Publish failed (...)</i>

Looking into the error log, I read the following error

<i>
[ Feb 26 2008 20:46:48 ] [80.202.211.60] eZMySQLDB:
Query error: Access denied for user: 'mplusplus_nl@%' to database 'mplusplus-nl'. Query: LOCK TABLES ezurlalias_ml WRITE
[ Feb 26 2008 20:46:48 ] [80.202.211.60] eZDBInterface::commit TRANSID-382f864d49bbc75ce444aa630bce9868:
Transaction in progress failed due to DB error, transaction was rollbacked. Transaction ID is TRANSID-382f864d49bbc75ce444aa630bce9868.
</i>

Those are actually two messages. The first is strange, because eZPublish DOES manage to create a series of tables in the database.
The second worried me the most, and I tried to investigate that. I found a couple of bug-reports (issue #007394, #007394, and #008163) that dealt with the problem, suggesting that I'd change the STRICT_TRANS_TABLES mode.

Here I'm lost: how do I do that? I'm running it on a hosted server, so I seem to have no access over MySQL 'running modes', or is there yet something else going on?

The server is running Linux (Debian) with MySQL and PHP5

Has anybody any tips?

I'd greatly appreciate it...

Maarten

Stéphane Bullier

Tuesday 26 February 2008 2:01:08 pm

Hello,

Have you applied this command on your database :

GRANT CREATE,DROP,ALTER,INDEX,DELETE,INSERT,SELECT,
      UPDATE,CREATE TEMPORARY TABLES,LOCK TABLES
    ON my_database_ez.*
    TO 'my_user_ez'@'localhost'
    IDENTIFIED BY 'super_password';
 
FLUSH PRIVILEGES;

Stéphane

maarten velde

Wednesday 27 February 2008 10:37:18 am

Hey!

Thanks for your answer. No, I didn't try it. Honestly, I don't know much about databases. I hoped I could install eZPublish without having to work my way through a book on mySQL.

Anyway, I tried after your suggestion, but I still don't succeed.

I try to ruyn your command as an SQL-query on phpMyAdmin, but I get an syntax error. I tried checking the command in the MySQL documentation, but as far as I can see, the syntax ought to be OK.

Again, I don't have this on a computer I can access freely. It's all on a host I pay for, so I can't tweak things.

Would you mind helping me furhter? I list the error-message from phpMyAdmin, everything is the same, apart from the password:

SQL query: 

GRANT CREATE , DROP , ALTER , INDEX , DELETE , INSERT , SELECT ,
UPDATE , CREATE TEMPORARY TABLES , LOCK TABLES ON mplusplus - nl . *
TO 'mplusplus_nl'@'mysql6.hostingdiscounter.nl'
IDENTIFIED BY '########';

MySQL said: Documentation
#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '-nl.*
   TO 'mplusplus_nl'@'mysql6.hostingdiscounter.nl'
   I

This suggest to me that the name of the database is illegal, but that sure can't be right?

Thanks in advance for help,

Maarten

Piotrek Karaś

Wednesday 27 February 2008 10:50:16 am

You don't have to learn SQL to solve that, provided that you have some sort of MySQL management frontend (for example PHPMyAdmin). In lamer terms, the user thought which you're trying to connect to the database doesn't have enough privileges to perform all the operations that are necessary. You have to grant all the basic privileges to the user, so that he can CREATE, DROP, ALTER, INDEX, DELETE... You may need root access to the DB, though.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

maarten velde

Wednesday 27 February 2008 1:35:26 pm

Thanks for clearing that out to me... That MySQL book might come one day,... I like more to learn by doing.

Is it correct that I enter these commands as an SQL query? That's what I'm trying to do and where I'm getting these error-messages.

I wonder if the cause could be the NAME of the database: it's supposed to be mplusplus-nl but the 'syntax error'-message point the name out as the cause. When I remove the dash "-", it doesn't throw this syntax-error message anymore. (Although it ofcourse DOES complain that the database doesn't exist)

Further, I found this on the internet, suggesting that the "-" is a illigal name in a table,...

<i>
Identifier characters - can be any alphanumeric character (as long as it’s in the default character set) plus ‘_’ and ‘$’. They can also start with any legal character (legal to be included in the identifier), even a digit. Identifiers can be quoted within ‘`’ (backtick or `), which allows the use of any character except the backtick .
</i>
http://www.idig.za.net/mysql-naming-rules/2006/11/17/

If this is the problem indeed, how come Ez came so far as actually creating tables in the database...?

Eh, * confused *,... :(

Thanks so far for your help, both!

Maarten

Dearg OBartuin

Thursday 11 December 2008 4:37:47 pm

Just in case anyone else has this issue:

The correct sql query to run is

GRANT SELECT , INSERT , UPDATE , DELETE , CREATE , DROP , INDEX , ALTER , CREATE TEMPORARY TABLES , LOCK TABLES ON `database_name` . * TO 'user_name'@'%'IDENTIFIED BY 'super_password';
WITH GRANT OPTION; FLUSH PRIVILEGES; 

This works on databases with localhost as the database location. if your database is hosted remotely use the following sql query

 GRANT SELECT , INSERT , UPDATE , DELETE , CREATE , DROP , INDEX , ALTER , CREATE TEMPORARY TABLES , LOCK TABLES ON `database_name` . * TO 'user_name'@'database_address'IDENTIFIED BY 'super_password';
WITH GRANT OPTION; FLUSH PRIVILEGES;

notice the replaced '%'

database_name = Name of your ez publish database
user_name = User name with privalages to set permissions
super_password = password associated to said username
database_address = location of database in most cases thsi is localhost

hope that helps,

Dearg

ps. if you have a web host you may find they do not allow Create Temporary Tables, if this is the case ask tech support very nicely and they may accept when telling them its related to ex publish.