473,666 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ODBC not connection to database

I am trying to set up an ODBC DSN to our company MySQL database so that I
can use a MS Access front end. I am using the MySQL ODBC 3.51 driver. The
database is running off of Apache on our Windows 2000 server (call it
'foobar'). The host is 'localhost', the user is 'root'. To access the
database via a web browser on a PC on our network, I use the address
'http://foobar:8080/". This works fine. If I set up a DSN on the server,
I connect to the database ok, but I have not been able to set up a DSN on
my PC.

If I use 'localhost' as the servername, I get the following message:
[MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'localhost'

If I use foobar:8080, I get '[MySQL][ODBC 3.51 Driver]Unknown MySQL server
host 'foobar:8080'

If I use 'foobar', I get '[MySQL][ODBC 3.51 Driver]Host 'BSANDERSON' is not
allowed to connect to this MySQL server'

This is my first attempt to set up a DSN and I really don't know what I'm
doing. Any help will be greatly appreciated.

Feb 6 '06 #1
4 16796
"Bob Sanderson" <sa*****@LUVSPA Msandmansoftwar e.com> wrote in message
news:Xn******** *************** ***********@207 .69.189.191...
I am trying to set up an ODBC DSN to our company MySQL database so that I
can use a MS Access front end. I am using the MySQL ODBC 3.51 driver. .. . . If I use 'foobar', I get '[MySQL][ODBC 3.51 Driver]Host 'BSANDERSON' is
not
allowed to connect to this MySQL server'


This is correct, but you got an error suggesting that your PC is not allowed
to connect to the MySQL service on foobar. This is a privilege issue. This
indicates that your ODBC connection succeeded in contacting the MySQL
service on foobar, but was denied access due to lack of privileges.

Whoever set up the MySQL service did not grant your PC the privilege to
connect directly to the MySQL service via the network. It is a typical
policy to enabled access only from applications running on the same host
(foobar), applications such as phpmyadmin. Though it is technically
possible to enable access from remote applications, it may have been
disallowed by default policy.

You should talk to the person who is responsible for administering the MySQL
service on your foobar machine, and ask them if it is okay for you to
connect directly to your company MySQL database from your PC using ODBC.

Regards,
Bill K.
Feb 6 '06 #2
"Bill Karwin" <bi**@karwin.co m> wrote in
news:ds******** @enews4.newsguy .com:
You should talk to the person who is responsible for administering the
MySQL service on your foobar machine, and ask them if it is okay for
you to connect directly to your company MySQL database from your PC
using ODBC.


Thanks for the reply. Unfortunately, that person is me and I don't know how
to do that.
Feb 6 '06 #3
"Bob Sanderson" <sa*****@LUVSPA Msandmansoftwar e.com> wrote in message
news:Xn******** *************** ***********@207 .69.189.191...
You should talk to the person who is responsible for administering the
MySQL service on your foobar machine, and ask them if it is okay for
you to connect directly to your company MySQL database from your PC
using ODBC.


Thanks for the reply. Unfortunately, that person is me and I don't know
how
to do that.


You should read the MySQL documentation on the access privilege system:
http://dev.mysql.com/doc/refman/5.0/...ge-system.html

And also the reference documentation on the statements used to administer
accounts and grant privileges:
http://dev.mysql.com/doc/refman/5.0/...ement-sql.html

So basically you need to grant privilege to some account on your PC to
connect to one or more databases. For example:

GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'bsa nderson' IDENTIFIED
BY 'password';

Quick explanations (read the docs for more information):
- databasename.* means all tables in the specified database
("databasename" ). You can also use a wildcard for the database name (*.*).
- 'username'@'bsa nderson' means the named user account is permitted to
connect only from the client host bsanderson. MySQL accounts are completely
distinct from operating system accounts, and you get to make up the user
name. Granting privileges to that named user implicitly "creates" the
account for purposes of connecting to MySQL. The host is the client host,
not the MySQL server host. Hosts may use '%' as a wildcard.
- IDENTIFIED BY 'password' means that the password inside the single quotes
is required for the user to connect from the specified client host. If you
leave out this clause, then no password is required (be careful with this!).

Notice:
- databasename.* is not in quotes.
- username and hostname are each individually in quotes, separated by a @
symbol, which is not in quotes.
- the password string is in quotes.

Regards,
Bill K.
Feb 6 '06 #4
"Bill Karwin" <bi**@karwin.co m> wrote in
news:ds******** *@enews1.newsgu y.com:
GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'bsa nderson'
IDENTIFIED BY 'password';


Thanks, Bill. That solved my problem. Much appreciated.
Feb 7 '06 #5

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

Similar topics

2
13635
by: GitarJake | last post by:
Hello all, I am trying to test an ODBC connection to an Oracle dbf using the ODBC Data Source Administrator. It's not working and I suspect I haven't configured Oracle correctly. Below is the error message I am getting: Invalid attribute in connection string: Description.ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect descriptor
2
8346
by: eSc | last post by:
I am trying to connect to Sage Line 50 data files through odbc driver (SageLine50v8) from php5 (running on windows xp pro) by odbc_connect(). Unfortunately I can not find right connection string and I get back an error: "SQL error: Cannot find all files in data path, SQL state 08001 in SQLConnect" This is what I am trying to do now: $connection_string="SageLine50v8";
1
5522
by: Lyle Fairfield | last post by:
I created a new MS-SQL Database, "TestODBC". I made Table1 and StoredProcedure1. I made an ODBC DSN for that MS-SQL Database. I created a new AccessXP mdb, "TestODBC". I linked to the table of the MS-SQL Database, "TestODBC". I wanted to use StoredProcedure1 as the bound recordsource for a new form Form1. But I
0
1852
by: Andrew | last post by:
Hi all, I've got users with an ODBC connection to a SQL Server database. The problem is that once users get that ODBC Connection from their network administrator, they can access any table and potentially delete any data. It's wide open. I know I can tighten security through SQL Server, but what I'd like to do is use an existing Access application that is connecting to the SQL Server database via that ODBC connectino to build me a DSN...
5
40401
by: Alec | last post by:
Hi All, I am currently trying to link in Access 97 to a table in a MSSQL 7 server. Initially the link is fine, however, when I close the access database and re-open it from the same network lacation on a different machine, it tells me that the ODBC connection to 'SQL Server Name' failed. How can I create the linked table permenant no matter what machine the networked database is opened on?
5
6084
by: Mike | last post by:
I am writing a .NET application in C# that uses Crystal Reports. I want the crystal reports to grab information from a database no matter where the database is located. To do this, I want to create an ODBC connection to the database at runtime in order for the report to grab data from the database. Does anyone have a code snippet that shows how to do this? Thank you very much for your reply. Mike
2
5519
by: Marco Martin | last post by:
Hi, I posted earlier about beeing able to find an SQL server database through code and someone was kind enough to help me out(thank you Scott). I now have another question; My app was written using odbc because of the need to install the program and use different databases depending on what the client has/owns. I now need to create an ODBC connection string during installation.
3
12943
by: Greg Strong | last post by:
Hello All, Is there any way to close an ODBC connection via DSN without completely closing the Access front-end? I'm doing some testing with using Access as a front-end to Oracle 10g Express edition. When the user ID and password is entered on a form and after a successful connection it seems Access doesn't change the connection. Even if I enter an invalid user ID and/or password the connection continues to work.
1
3580
by: Pradeep83 | last post by:
Hi All Problem : I am unable to retrieve the data from the table in postgres database using C application which i have written in solaris os. Query: How to check whether connection is there between postgres database and C application(which we have written for accessing the database) ? My code is comiling successfully if i run it then its giving o/p as following : output
4
6474
by: Rodent | last post by:
I have an IIS 6.0, 2003 Server running with PHP installed. I have an access database with a DSN ODBC connection configured. When this ODBC is configured to access the database locally - great, works fine. When configured to access a remote copy of this database I get the following : "....Warning: odbc_connect() : SQL error:
0
8871
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...
0
8783
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8552
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
8640
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
7387
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
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2773
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1776
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.