View Full Version : Error Installing phpBB2
PolarBair
Jun 8, 2005, 11:05 AM
I'm getting an error when I try to install phpBB2 on my website. The error is:
An error occurred trying to update the database
You have an error in your SQL syntax near '-_auth_access ( group_id mediumint(8) DEFAULT '0' NOT NULL, forum_id small' at line 10
Any one have any idea how to fix this?
eva01
Jun 8, 2005, 12:39 PM
has it only happened once? if so then just delete the database and re-download phpbb2 and then start over.
or you can ask someone else to do it for you.
davecuse
Jun 8, 2005, 02:47 PM
If its having trouble writing to the database maybe the username doesn't have sufficient rights.
Knox
Jun 8, 2005, 03:04 PM
I'm getting an error when I try to install phpBB2 on my website. The error is:
An error occurred trying to update the database
You have an error in your SQL syntax near '-_auth_access ( group_id mediumint(8) DEFAULT '0' NOT NULL, forum_id small' at line 10
What did you enter for the table prefix value in the installation procedure? If you can't remember, look at $table_prefix in config.php (root directory of phpBB). From that error message it looks like the value contains a dash (-) which isn't a valid value for a database table name, _ is allowed but not -.
MontyZ
Jun 8, 2005, 03:29 PM
What did you enter for the table prefix value in the installation procedure? If you can't remember, look at $table_prefix in config.php (root directory of phpBB). From that error message it looks like the value contains a dash (-) which isn't a valid value for a database table name, _ is allowed but not -.
You can use a dash in the name of a MySQL table, it's not an illegal character. I've used them myself with no problems.
http://dev.mysql.com/doc/mysql/en/legal-names.html
PolarBair, I'm not sure what the error message means without seeing the full statement that caused the problem. You may want to try posting this in the phpBB support forum instead.
Knox
Jun 8, 2005, 04:03 PM
You can use a dash in the name of a MySQL table, it's not an illegal character. I've used them myself with no problems.
Ah, so you can, but only if you do `table-name` I think, which I don't believe phpBB does.
"An identifier may be quoted or unquoted. If an identifier is a reserved word or contains special characters, you must quote it whenever you refer to it. For a list of reserved words, see Section 9.6, “Treatment of Reserved Words in MySQL”. Special characters are those outside the set of alphanumeric characters from the current character set, '_', and '$'."
mysql> create table test-test (id int);
ERROR 1064: You have an error in your SQL syntax near '-test (id int)' at line 1
mysql> create table `test-test` (id int);
Query OK, 0 rows affected (0.00 sec)
MontyZ
Jun 9, 2005, 04:23 AM
Yes, the backticks are needed around the table name. I always use the backticks in my code, especially if you are going to allow the user to control table names. phpBB probably didn't do this, and that's probably what's causing the error.
Good eyes! :)
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.