Mysql/postgrsql detailed instructions on how to access the Mysql Guide with an ODBC interface _mysql

Source: Internet
Author: User
Tags odbc
Detailed instructions on how to access the MySQL Guide with an ODBC interface
MySQL's ODBC interface implementation is through the installation of MYODBC driver, this driver is cross-platform. If used under UNIX systems such as Linux, you need to first install IODBC these third-party ODBC standard support platforms.

Simple ASP Sample code:
Copy Code code as follows:

<%
Dim sql,mysql
Set sql = Server.CreateObject ("Adodb.connection")
Mysql= "Driver={mysql ODBC 3.51 driver};d atabase= Library;
server= host; uid= user; PassWord
= password; ' option = Set
Sql.open MySQL
%>


The above code is an example of a MYODBC development version 3.51 connection, using the development version because of new features and stability that are not available in the 2.x official edition. A few days ago I read a tutorial on how to write a security program written by Microsoft security experts. The above mentioned that if the code of the ASP file is seen by the hacker in the example above, the database may not be insured, then a series of problems can be raised, and even the administrative privileges are captured. In the article, the workaround is to connect the database by writing a COM component and then by invoking the method of the component by the ASP. The advantage of this is that it improves security, but the problem is that people who have the ability to do so are in the minority. So my compromise is to define the data source. The definition of libraries, users, passwords, and setting these connection information in the data source greatly simplifies the difficulty of implementation and also enhances security. Of course, in order to ensure that the data source can be accessed in the actual operating environment, it must be defined as a "system data source", defined as a "user data source" or "system data source" at development time. I think it's harmless.
Copy Code code as follows:

<%
Dim sql
Set sql = Server.CreateObject ("Adodb.connection")
Sql.open "Dns=mysql Data Source Name"
%>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.