Databases - FAQ

 

1. How many Data Source Names (DSNs) can I have?

2. How many databases can I utilize?

3. How can I create a DSN for my database connection MS Access?

4. How can I create a DSN for my database connection using ASP/ASP.NET or ColdFusion/ColdFusion MX?
5. I'm trying to use a Microsoft Access database but I'm getting this error;
"MDAC - Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes or the file may be corrupt." Why?

6. Can I use the LOAD DATA LOCAL for MySQL?

7. How do I connect to a MySQL database using PHP?

 

 

 

 

 

 


1. How many Data Source Names (DSNs) can I have?

Maximum 2


 

2. How many databases can I utilize?

Two if DSNs are required, however Access files can be used with a DSNless connection from public directory.


 

3. How can I create a DSN for my database connection MS Access?

When creating a DSN, the following will be required:

 

Domain Name
Database Name
Database Type: MS Access/MySQL
DSN Prefix (the prefix will precede _yourdomain_extension)
Example: db_yourdomain_com

 

When using MS Access, we will require the database to reside in a directory named "databases" within the root folder. Once you have created your "databases" directory, please contact us with the above information and we will create the DSN for you.


 

4. How can I create a DSN for my database connection using ASP/ASP.NET or ColdFusion/ColdFusion MX?

When creating a DSN, the following will be required:

 

Domain Name
Database Name
Database Type: MS Access/MySQL
DSN Prefix (the prefix will precede _yourdomain_extension)
Example: db_yourdomain_com

 

Please ensure that Windows services is enabled in your ACS Domain Management Control Panel (ASP/ASP.NET or ColdFusion/ColdFusion MX), otherwise DSN cannot be created.


 

5. I'm trying to use a Microsoft Access database but I'm getting this error;
"MDAC - Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes or the file may be corrupt." Why?

 

The latest MDAC (version 2.7), which is currently installed on our system, is not compatible with Access 97 databases. Although your database may have worked initially, once you write data to the database it will throw this error. In our shared
hosting environment, our main focus is security. In order for us to maintain our strict security model, our operating systems must be updated with current service packs and patches. If this is an Access 2000 database, it is likely that it has been
corrupted.


 

6. Can I use the LOAD DATA LOCAL for MySQL?

This specific command poses a security issue and has been disabled. To work around the issue, We have a number of options available to you, including:

 

Work around for phpMyAdmin:
If the file is the result of a MySQL dump then they can cut/copy&paste the contents into the query window

 

Work around for MySQL-Front:
Using version 2.2, 2.3, or 2.4 (and not 2.5), simply use the "Import Textfile" function to import .CSV files.

 

REFERENCES FROM http://www.mysql.com/doc/en/LOAD_DATA_LOCAL.html:

 

4.2.4 Security issues with LOAD DATA LOCAL
In MySQL 3.23.49 and MySQL 4.0.2, we added some new options to deal with possible security issues when it comes to LOAD DATA LOCAL.

 

There are two possible problems with supporting this command:

 

As the reading of the file is initiated from the server, one could theoretically create a patched MySQL server that could read any file on the client machine that the current user has read access to, when the client issues a query against the table.

 

In a web environment where the clients are connecting from a web server, a user could use LOAD DATA LOCAL to read any files that the web server process has read access to (assuming a user could run any command against the SQL server).

 

There are two separate fixes for this:

 

If you don't configure MySQL with --enable-local-infile, then LOAD DATA LOCAL will be disabled by all clients, unless one calls mysql_options(... MYSQL_OPT_LOCAL_INFILE, 0) in the client. See section 8.4.3.163 mysql_options().

 

For the mysql command-line client, LOAD DATA LOCAL can be enabled by specifying the option --local-infile[=1], or disabled with --local-infile=0.

 

By default, all MySQL clients and libraries are compiled with --enable-local-infile, to be compatible with MySQL 3.23.48 and before.

 

One can disable all LOAD DATA LOCAL commands in the MySQL server by starting mysqld with --local-infile=0.

 

In the case that LOAD DATA LOCAL INFILE is disabled in the server or the client, you will get the error message (1148):

 

The used command is not allowed with this MySQL version.


 

7. How do I connect to a MySQL database using PHP?

DSN connections are not supported for PHP to MySQL databases. To connect to a MySQL database using PHP, please use a standard connection string simmilar to the following:

 

<?
$dbhost = "sqlc1.megasqlservers.com"; /* database server */
$dbuser = "dbm.domainname.com"; /* database username */
$dbpass = "password"; /* database password */
$dbname = "dbname_domainname_com"; /* database name */
$db = mysql_connect($dbhost,$dbuser,$dbpass); /* connecting to database*/
SELECT * FROM table;
?>