473,597 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Probably a permissions problem.

Hi

I connect to my MySQL database using MyODBC.

I have a table called 'log' in a database called 'home'. When I try to
do an insert like this:
insert into log (userid,event,e vent_date) values (blah blah....

I get this error response from MySQL:
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 'log
(userid,event,e vent_d
ate) values ('nt','HomeDB Started',now()) ' at line 1

However, if I use :
insert into home.log (userid,event,e vent_date) values (blah blah....

It all works OK.
I have another table in the same database which doesn't exhibit this
problem.

Is this some sort of permissions or access rights issue?

Any help appreciated.

Regards

Nick

Jul 27 '06 #1
5 2242
>I connect to my MySQL database using MyODBC.
>
I have a table called 'log' in a database called 'home'. When I try to
do an insert like this:
insert into log (userid,event,e vent_date) values (blah blah....

I get this error response from MySQL:
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 'log
(userid,event, event_d
ate) values ('nt','HomeDB Started',now()) ' at line 1
Is log a MySQL keyword in your version of MySQL?
If so, quote the table name (`log`). Or perhaps it's `event`
that's a keyword (5.1.6 and later). What version are you running?
>However, if I use :
insert into home.log (userid,event,e vent_date) values (blah blah....

It all works OK.
I have another table in the same database which doesn't exhibit this
problem.

Is this some sort of permissions or access rights issue?
Permissions and access rights issues should not draw 'syntax error'
error messages. If they do, file a bug report.
Jul 28 '06 #2

Gordon Burditt wrote:
I connect to my MySQL database using MyODBC.

I have a table called 'log' in a database called 'home'. When I try to
do an insert like this:
insert into log (userid,event,e vent_date) values (blah blah....

I get this error response from MySQL:
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 'log
(userid,event,e vent_d
ate) values ('nt','HomeDB Started',now()) ' at line 1

Is log a MySQL keyword in your version of MySQL?
If so, quote the table name (`log`). Or perhaps it's `event`
that's a keyword (5.1.6 and later). What version are you running?
MySQL version 4.1.9-nt. On Win2K.
>
However, if I use :
insert into home.log (userid,event,e vent_date) values (blah blah....

It all works OK.
I have another table in the same database which doesn't exhibit this
problem.

Is this some sort of permissions or access rights issue?

Permissions and access rights issues should not draw 'syntax error'
error messages. If they do, file a bug report.
Well, I don't understand it. I have the same Database setup at home,
and it all works fine. Both systems are Win2K with the same versions of
MyODBC and MySQL. There must be some difference in user permissions
causing this.

Thanks for the suggestions anyway.

Jul 28 '06 #3

Gordon Burditt wrote:
I connect to my MySQL database using MyODBC.

I have a table called 'log' in a database called 'home'. When I try to
do an insert like this:
insert into log (userid,event,e vent_date) values (blah blah....

I get this error response from MySQL:
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 'log
(userid,event,e vent_d
ate) values ('nt','HomeDB Started',now()) ' at line 1

Is log a MySQL keyword in your version of MySQL?
If so, quote the table name (`log`). Or perhaps it's `event`
that's a keyword (5.1.6 and later). What version are you running?
MySQL version 4.1.9-nt. On Win2K.
>
However, if I use :
insert into home.log (userid,event,e vent_date) values (blah blah....

It all works OK.
I have another table in the same database which doesn't exhibit this
problem.

Is this some sort of permissions or access rights issue?

Permissions and access rights issues should not draw 'syntax error'
error messages. If they do, file a bug report.
Well, I don't understand it. I have the same Database setup at home,
and it all works fine. Both systems are Win2K with the same versions of
MyODBC and MySQL. There must be some difference in user permissions
causing this.

Thanks for the suggestions anyway.

Jul 28 '06 #4
Control Freq wrote:
I have the same Database setup at home,
and it all works fine. Both systems are Win2K with the same versions of
MyODBC and MySQL.
I just thought of a possibility: LOG() is a built-in math function.
MySQL treats a space between a function and its parentheses as
significant. So "LOG (...)" is different from "LOG(...)".

Is it possible that in one environment, you don't have a space after
"LOG", so MySQL thinks you mean the LOG() math function? Which would of
course be nonsensical in the context of an INSERT statement, in a place
where a table name belongs.

If you are building the SQL statement with string concatenation, watch
out for situations like the following:

$sql_statement = "insert into log"
+ "(userid, event, event_date) values ..."

Notice the above creates a string with "log" right next to the following
parenthesis, with no space in between. This may confuses the MySQL
parser.

In fact, trying it in my MySQL instance, I was able to reproduce the
error you saw by putting no space in "log(...", and it works correctly
by putting a space in "log (...".

Regards,
Bill K.
Jul 30 '06 #5
Probably a silly questions, but is the same user which created the
table log, the same user which is trying to access the table?

Failing that you can always create a synonym name for the table...

Description:

The CREATE SYNONYM statement (create_synonym _statement) defines a
synonym (alternative name) for a table name.

Syntax:

<create_synonym _statement::=
CREATE [PUBLIC] SYNONYM [<schema_name> .]<synonym_nameFO R
<table_name>
Control Freq wrote:
Gordon Burditt wrote:
>I connect to my MySQL database using MyODBC.
>
>I have a table called 'log' in a database called 'home'. When I try to
>do an insert like this:
>insert into log (userid,event,e vent_date) values (blah blah....
>
>I get this error response from MySQL:
>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 'log
>(userid,event, event_d
>ate) values ('nt','HomeDB Started',now()) ' at line 1
Is log a MySQL keyword in your version of MySQL?
If so, quote the table name (`log`). Or perhaps it's `event`
that's a keyword (5.1.6 and later). What version are you running?

MySQL version 4.1.9-nt. On Win2K.
>However, if I use :
>insert into home.log (userid,event,e vent_date) values (blah blah....
>
>It all works OK.
>I have another table in the same database which doesn't exhibit this
>problem.
>
>Is this some sort of permissions or access rights issue?
Permissions and access rights issues should not draw 'syntax error'
error messages. If they do, file a bug report.

Well, I don't understand it. I have the same Database setup at home,
and it all works fine. Both systems are Win2K with the same versions of
MyODBC and MySQL. There must be some difference in user permissions
causing this.

Thanks for the suggestions anyway.
Jul 31 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
6868
by: lkrubner | last post by:
I want to give users the power to edit files from an easy interface, so I create a form and a PHP script called "fileUpdate". It does a reasonable about of error checking and prints out some errors. It uses fileperms() to get the permissions of the file, and it includes that info in any error message. Today I'm getting the following error message. I've used SmartFtp to go in and set the test file's permissions to 777, but in this error...
7
2548
by: Kim Lots | last post by:
Hi Sorry to disturb you again but i really like to know what's the NTFS folder permissions on a "virtual directory" folder for a public webserver iis 5.x running ASP 3.0 with an Access DB on a w2k pro machine with anonymous access. Fyg this is non commercial website for neighbour members in a carpool with booking possibility. No file upload is allowed/possible/needed. Login is manged by the ASP script
1
4363
by: Chris | last post by:
I have seen the posts on various places on the internet about .NET framework mismatch issues and I don't think that is my problem. ; ) When I execute the following C++.NET code: String *ipAddress = S""; IDictionary *server_config = dynamic_cast<IDictionary*>(ConfigurationSettings::GetConfig("ServerAddress") ); ipAddress = dynamic_cast<String*>(server_config->get_Item(S"IP"));
9
10880
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent the wheel, right? Everything so far is working well with the Active Directory. The problem I am having is with adding File Permissions to a directory. I am currently using some code courtesy of "Willy Denoyette "
3
4434
by: palepimp | last post by:
Hello all, I have searched far and wide for a solution to my issue. In short, here is the problem: 1. 3 PC's enter data into an Access 2003 database (PC's are running Vista w/ Office 2007 pro). The database has been used for a long time and we haven't upgraded it to a 2007 version database. 2. One of the PC's hosts the "master" database, the 2 others are using Replica's of "master" database. At the end of each work day, the...
3
12042
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. (machine.config) ---> System.Security.SecurityException: Request for the permission of type
1
2218
by: beary | last post by:
Hello everyone, I'm not sure if this is the correct forum for this, and apologies for the length of this question, but I'm desperate for some good advice... I'm in way over my head with file permissions. The directory and files are sitting on a linux server. I know almost nothing about linux. The background: I was given a web share by my IT admin. Initially, the web share had 3 users, myself (as the owner) ,root (the group) and...
2
2038
by: beary | last post by:
Hello everyone, I posted this in unix/linux but it received no replies, so I assume it was the wrong forum. I'm trying here. I'm in way over my head with file permissions. The directory and files are sitting on a linux server. I know almost nothing about linux. The background: I was given a web share by my IT admin. Initially, the web share had 3 users, myself (as the owner) ,root (the group) and everyone. I could copy and paste from my...
13
2647
by: eclipsme | last post by:
I thought I had this licked, but apparently not. I have a file upload script that attempts to upload a file to a directory in the public_html directory - www.domain.com/upload The permissions for the directory have to be 777 for this to work or esle it aborts with a permissions error - obviously a problem. The php script runs as user 'nobody'. Tech support is through email, and level one is not that bright, or at
0
7969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8272
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8035
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8258
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6688
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5431
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3886
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1494
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1238
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.