473,323 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

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 16769
"Bob Sanderson" <sa*****@LUVSPAMsandmansoftware.com> wrote in message
news:Xn**********************************@207.69.1 89.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.com> 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*****@LUVSPAMsandmansoftware.com> wrote in message
news:Xn**********************************@207.69.1 89.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'@'bsanderson' 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'@'bsanderson' 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.com> wrote in
news:ds*********@enews1.newsguy.com:
GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'bsanderson'
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
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...
2
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...
1
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...
0
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...
5
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...
5
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...
2
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...
3
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...
1
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...
4
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,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.