设为首页 收藏本站
查看: 864|回复: 0

Install and Create MySQL ODBC Connector on Windows 7 64 bit

[复制链接]

尚未签到

发表于 2015-5-10 15:16:19 | 显示全部楼层 |阅读模式
Install and Create MySQL ODBC Connector on Windows 7 64 bit

DSC0000.png March 31, 2012 | Posted by   Hao Nguyen  bookmarks


Tweet
inShare
DSC0001.png
Why install ODBC Connector for MySQL?
  ODBC connector works as a standard gateway for programming languages, applications (such as Excel, Access, or OpenOffice) to communicate with database server with ease.

  The database behind ODBC Connector could be MySQL, Microsoft SQL, PostgreSQL, Microsoft Access, or FileMaker, and more. You do not have to input the direct connection string into the code. You just need to know how to contact to ODBC Connector in a very simple way; especially, Delphi even makes it simpler with a few clicks.


If you want to see how to connect Delphi to mysql ODBC, click here to link to Connect Delphi to MySQL using ODBC.You could see the usage of MySQL in these two cases.
  The first case is to connect to a local MySQL Server. It means you have MySQL Server running on your local computer.
DSC0002.png
  In this case, the grant permission command is not necessary because MySQL allows localhost (127.0.0.1) to connect by default.
  The second case is to connect to a remote MySQL Server. In this case, you want to connect to a remote machine where MySQL is running. Sometimes, we need to access to a remote MySQL to do some automatic tasks, such as maintaining database, checking database, or updating a WordPress blog using an auto web crawler application. If you want to run an application on one server and access database on another server, this case can be used.
DSC0003.png
  In this case, the administrator on the machine 192.168.11.130 must execute the GRANT command. More about GRANT command in MySQL. Back to top
Which version should I go?
  As this time of writing, there are two public versions of MySQL Connectors, 3.51 and 5.1. Both versions support Windows from XP to 7 32 bit to 64 bit.
Summary steps


  • Download MySQL Connectors
  • Install MySQL Connectors on your Windows
  • Setup MySQL Grant Permission to allow this computer to connect
  • Setup an ODBC Connector from Windows machine.
  • Test ODBC Connector

How to install ODBC Connector for MySQL in details
  The easiest way to install MySQL ODBC Drivers on Windows is to use MSI Package. MSI package supports both Windows 32 bit and 64 bit.
Step 1. Download MySQL Connectors

  • Now, we start the first step is to go to this URL http://www.mysql.com/downloads/connector/odbc/3.51.html#downloads
  • Select Microsoft Windows as the platform.
  • Select Windows (x86, 64-bit), MSI Installer
  • Connector-ODBC  if you have 64 bit operating system, otherwise, select 32 bit.
  • Click Download.
  • Simply click “No thanks, just take me to the downloads!” if MySQL ask you to register an account.

  


Download from a trusted source
DSC0004.png
Warning

– If you download the ODCB Connector from some other sources, make sure to check the MD5 hash key  
  Don’t know how the MD5 hash key works? SeeHow to verify MD5 signature.
  
  Back to top
Step 2. Install MySQL Connectors on your Windows

  • Double click on the file “mysql-connector-odbc-3.51.30-winx64.msi” that you just downloaded to run the setup process.
  • Click Next and accept the license agreement.
  • Select Custom to see what we will have after the installation

DSC0005.png

  • The package MySQL 64 bit allows you to install both 32 and 64 bit Connector. This is just an optional option, you could click Next now to continue another step.

DSC0006.jpg

  • Click Install to let the Setup Wizard do the rest.
  Back to top
Step 3. Setup MySQL Grant Permission to allow this computer to connect

Save your time - You do not have to complete this step if you are connecting to a MySQL Server on your local machine.  This task should be done on the remote MySQL Server in the second type. Click here to see the figure again. On MySQL Server, login as root or any account with GRANT permission, issue this command

GRANT ALL ON *.* TO ‘newaccount’@’192.168.11.1′ IDENTIFIED BY “test123456″;  newaccount could be replaced by any usernames that you want to use. test123456 is the password for newaccount. The phase ‘192.168.11.1‘ means this account is only valid when connects from the server 192.168.11.1

DSC0007.png   Back to top
Step 4. Setup an ODBC Connector from Windows machine.

  • Go to Control Panel –> Administrative Tools and select Data Sources (ODBC), execute it.

DSC0008.png   This tool allows you to create new ODBC Connector for you or your computer.
  
  The ODBC Data Source Administrator appears, where you could create new DSN for you, or for your computer.


Tips: User DSN is Adds, deletes, or sets up data sources with user data source names (DSNs). These data sources are local to a computer and accessible only by the current user (User level).  
  System DSN is Adds, deletes, or sets up data sources with system data source names (DSNs). These data sources are local to a computer but not user-dedicated; any user with privileges can access a system DSN (Computer level).
  In this case, I would like to setup an DSN (ODBC Connector) that is available to every user account on my computer, I will click the tab System DSN.

  • Click Add to add a new ODBC Connector
  • Select MySQL ODBC 3.51Driver

DSC0009.png

  • Click Finish to enter another dialogue where you can setup some necessary parameters.

DSC00010.png

Leave field Database empty

Stay out of trouble – just leave the field Database empty. If you select some database here, you might run into some weird problems with MySQL ODBC Connector. You must specify database name in your SELECT command. Example: SELECT * FROM plaintutdb.table_employees;  Data Source Name – The name that your application will use to communicate with this ODBC Connection.
  Description – Anything that for your understanding (useful in case you have so many ODBC Connectors on your machine)
  TCP/IP Server – IP address or DNS Name of the MySQL Server. In this case, my remote MySQL Server has the IP of 192.168.11.130.
  User – Username on the MySQL box. This is the username in the GRANT command at Step 3. More about GRANT command on MySQL.
  Back to top
Step 5. Test ODBC Connector
  Click Test button and wait for the success message pop-up. You should expect a pop-up message like this.
DSC00011.png
  If you have some error at this point, go back to Step 3 and make sure you have enough permission.
  A common error message could happen is Connection Failed: [HY000] [MySQL][ODBC 3.51 Driver][Host ‘your-ip-address’ is not allowed to connect to this MySQL server.
DSC00012.png
  This problem happen because you do not have permission to connect to the database from the IP address 192.168.11.1, or you entered wrong password. The password is test123456 which I entered on the GRANT command at step 3.
  OR, you might have an error message like this: "Connection Failed: [HY000] [MySQL][ODBC 3.51 Driver]Access denied for user ‘newaccount’@’192.168.11.1′ (using password: YES)“. The root causes of this error message are: you type wrong password, OR the password is too complex.


MySQL ODBC 3.51 No-Complex Password

Warning – You might have a serious headache with MySQL ODBC 3.51 if the password in your GRANT command contains special characters, such as ! @ # $ % ^ ?. MySQL ODBC 3.51 ODBC Driver does not support these special characters in the password box. The only error message you would receive is “Access denied” (using password: YES)  

  
  To this point, you could connect your database application to MySQL Server using the new ODBC Connector created from this tutorial.
  Back to top

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-65541-1-1.html 上篇帖子: 转帖--Windows Phone 7开发环境搭建 下篇帖子: Windows Phone 7 位图编程
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表