473,394 Members | 2,160 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,394 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 16779
"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...

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.