`
youanyyou
  • 浏览: 194886 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
社区版块
存档分类
最新评论

mysql数据库与win7兼容问题解决办法

阅读更多

  有的win7版本可以和mysql兼容,可以很容易安装上去。但有的版本不行。

  我之前的win7上装不了mysql5.0,但可以装上mysql5.1。但是我重装了新的win7之后就都装不上去了。我试了四五个版本,装了不下10次,但每一次都是最后一步卡住了。

  突然我想到了直接把安装好的mysql5.0的整个文件夹都拷过来,于是便开始动手试了试,三个小时后终于试验成功了。

  方法如下:

  下载一个安装好的mysql压缩包。

  首先找到my.ini,没有就建一个。做如下配置

Java代码 
  1. [client]  
  2. #password   = your_password  
  3. port        = 3306  
  4. socket      = /tmp/mysql.sock  
  5.   
  6. [WinMySQLadmin]   
  7.   
  8. Server=C:/MySQL/MySQL_Server_5.0/bin/mysqld-nt.exe  
  9.   
  10. # Here follows entries for some specific programs  
  11.   
  12. # The MySQL server  
  13. [mysqld]  
  14. port        = 3306  
  15.   
  16. #Path to installation directory. All paths are usually resolved relative to this.  
  17. basedir="C:/MySQL/MySQL_Server_5.0/"  
  18.   
  19. #Path to the database root  
  20. datadir="C:/MySQL/MySQL_Server_5.0/data"  
  21.   
  22. # The default character set that will be used when a new schema or table is  
  23. # created and no character set is defined  
  24. default-character-set=utf8  
  25.   
  26. socket      = /tmp/mysql.sock  
  27. skip-locking  
  28. key_buffer = 256M  
  29. max_allowed_packet = 1M  
  30. table_cache = 256  
  31. sort_buffer_size = 1M  
  32. read_buffer_size = 1M  
  33. read_rnd_buffer_size = 4M  
  34. myisam_sort_buffer_size = 64M  
  35. thread_cache_size = 8  
  36. query_cache_size= 16M  
  37. # Try number of CPU's*2 for thread_concurrency  
  38. thread_concurrency = 8  
  39.   
  40. # Don't listen on a TCP/IP port at all. This can be a security enhancement,  
  41. if all processes that need to connect to mysqld run on the same host.  
  42. # All interaction with mysqld must be made via Unix sockets or named pipes.  
  43. # Note that using this option without enabling named pipes on Windows  
  44. # (via the "enable-named-pipe" option) will render mysqld useless!  
  45. #   
  46. #skip-networking  
  47.   
  48. # Replication Master Server (default)  
  49. # binary logging is required for replication  
  50. log-bin=mysql-bin  
  51.   
  52. # required unique id between 1 and 2^32 - 1  
  53. # defaults to 1 if master-host is not set  
  54. # but will not function as a master if omitted  
  55. server-id   = 1  
  56.   
  57. # Replication Slave (comment out master section to use this)  
  58. #  
  59. # To configure this host as a replication slave, you can choose between  
  60. # two methods :  
  61. #  
  62. 1) Use the CHANGE MASTER TO command (fully described in our manual) -  
  63. #    the syntax is:  
  64. #  
  65. #    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,  
  66. #    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;  
  67. #  
  68. #    where you replace <host>, <user>, <password> by quoted strings and  
  69. #    <port> by the master's port number (3306 by default).  
  70. #  
  71. #    Example:  
  72. #  
  73. #    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,  
  74. #    MASTER_USER='joe', MASTER_PASSWORD='secret';  
  75. #  
  76. # OR  
  77. #  
  78. 2) Set the variables below. However, in case you choose this method, then  
  79. #    start replication for the first time (even unsuccessfully, for example  
  80. #    if you mistyped the password in master-password and the slave fails to  
  81. #    connect), the slave will create a master.info file, and any later  
  82. #    change in this file to the variables' values below will be ignored and  
  83. #    overridden by the content of the master.info file, unless you shutdown  
  84. #    the slave server, delete master.info and restart the slaver server.  
  85. #    For that reason, you may want to leave the lines below untouched  
  86. #    (commented) and instead use CHANGE MASTER TO (see above)  
  87. #  
  88. # required unique id between 2 and 2^32 - 1  
  89. # (and different from the master)  
  90. # defaults to 2 if master-host is set  
  91. # but will not function as a slave if omitted  
  92. #server-id       = 2  
  93. #  
  94. # The replication master for this slave - required  
  95. #master-host     =   <hostname>  
  96. #  
  97. # The username the slave will use for authentication when connecting  
  98. # to the master - required  
  99. #master-user     =   <username>  
  100. #  
  101. # The password the slave will authenticate with when connecting to  
  102. # the master - required  
  103. #master-password =   <password>  
  104. #  
  105. # The port the master is listening on.  
  106. # optional - defaults to 3306  
  107. #master-port     =  <port>  
  108. #  
  109. # binary logging - not required for slaves, but recommended  
  110. #log-bin=mysql-bin  
  111.   
  112. # Point the following paths to different dedicated disks  
  113. #tmpdir     = /tmp/       
  114. #log-update     = /path-to-dedicated-directory/hostname  
  115.   
  116. # Uncomment the following if you are using BDB tables  
  117. #bdb_cache_size = 64M  
  118. #bdb_max_lock = 100000  
  119.   
  120. # Uncomment the following if you are using InnoDB tables  
  121. #innodb_data_home_dir = /usr/local/var/  
  122. #innodb_data_file_path = ibdata1:10M:autoextend  
  123. #innodb_log_group_home_dir = /usr/local/var/  
  124. #innodb_log_arch_dir = /usr/local/var/  
  125. # You can set .._buffer_pool_size up to 50 - 80 %  
  126. # of RAM but beware of setting memory usage too high  
  127. #innodb_buffer_pool_size = 256M  
  128. #innodb_additional_mem_pool_size = 20M  
  129. # Set .._log_file_size to 25 % of buffer pool size  
  130. #innodb_log_file_size = 64M  
  131. #innodb_log_buffer_size = 8M  
  132. #innodb_flush_log_at_trx_commit = 1  
  133. #innodb_lock_wait_timeout = 50  
  134.   
  135. [mysqldump]  
  136. quick  
  137. max_allowed_packet = 16M  
  138.   
  139. [mysql]  
  140. no-auto-rehash  
  141. # Remove the next comment character if you are not familiar with SQL  
  142. #safe-updates  
  143.   
  144. [isamchk]  
  145. key_buffer = 128M  
  146. sort_buffer_size = 128M  
  147. read_buffer = 2M  
  148. write_buffer = 2M  
  149.   
  150. [myisamchk]  
  151. key_buffer = 128M  
  152. sort_buffer_size = 128M  
  153. read_buffer = 2M  
  154. write_buffer = 2M  
  155.   
  156. [mysqlhotcopy]  
  157. interactive-timeout  

 

 

 其中有三个路径 是你把解压好的文件夹所放的路径,这个路径名中不能有空格。

your_password是你的用户密码,你可以填入你想要的密码,不用引号。

保存好之后到“运行”中去执行一条指令:C:/MySQL/MySQL_Server_5.0/bin/mysqld-nt.exe --install。注意换成你的目录。

这样就注册好了一个mysql服务。接下来就是启动服务:

新建一个文件:start_SQLServer.bat

内容如下

Java代码 
  1. @ECHO OFF  
  2.   
  3. if exist "%cd%\my.ini" goto startsrv  
  4. for /f %%i in ('net start'do if %%i==MySQL goto MySQL_IsRunning  
  5.  goto MySQL_NotRunning  
  6.   
  7. :MySQL_IsRunning  
  8.  echo "found Server!"  

深圳人才网 深圳招聘网 深圳人才招聘网 深圳人才大市场 

企业、个人免费注册,获取想要的 深圳 软件工程师招聘信息 月薪最低3000-8000,更有高端猎头职位! 

www.szrcwz.com                                                                                                                                           

                  Google 提供的广告

分享到:
评论

相关推荐

    win7安装MySql源文件和安装教程

    在MySQL安装中,这可能是为了自定义安装界面或解决特定版本的兼容性问题。如果你遇到任何问题,例如汉化或权限问题,可以考虑使用该工具。 安装完成后,你应当能够通过命令行工具(如cmd)或图形化管理工具(如...

    mysql win7安装包

    MySQL是一款广泛使用的开源关系型数据库管理系统,其在Windows 7操作系统上的安装过程是许多IT从业者和爱好者必须掌握的基础技能。本安装包适用于Windows 7 64位系统,经过亲测,确保了其兼容性和稳定性。 首先,让...

    unity3d连接mysql数据库

    在Unity3D游戏开发中,有时需要与外部数据库进行交互,比如存储用户数据、游戏进度等,MySQL数据库因其开源、高效、稳定等特性,经常被选作后端数据存储的解决方案。本教程将详细介绍如何在Unity3D 4.0环境下连接到...

    mySQL 64位win7安装教程及软件

    以下是一份详细的MySQL 64位在Win7上安装的教程。 ### 安装前准备 1. **系统兼容性**:确保你的Windows 7系统是64位的,因为你要安装的是64位MySQL。 2. **硬件需求**:至少2GB内存,但推荐4GB或更多以确保良好运行...

    MYSQL数据库配置与安装完全版教程

    MySQL数据库配置与安装.txt文件中应包含更详细的命令行操作示例和MySQL的使用教程,包括数据表创建、数据插入、查询、更新和删除等操作。此外,熟悉SQL语句和理解MySQL的存储引擎,如InnoDB和MyISAM,对数据库管理和...

    mysql 5.2 odbc win7 64位

    在Win7 64位操作系统中,必须使用与系统架构匹配的驱动程序,即64位版本的MySQL Connector/ODBC。"mysql-connector-odbc-5.2.5-winx64.msi"文件正是这样的一个64位驱动程序安装包,用于在Windows 7 64位环境下安装...

    QC10.0兼容win7的解决方法

    描述中提到的“只需2步就解决你的兼容问题”,暗示了解决方案非常简洁高效。这种简洁性使得用户能够快速理解和执行,避免了复杂的配置步骤。尽管文档内容不多,但其精炼的指导通常能够直击问题的核心,提供有效的...

    mysql-5.5.56-winx64 数据库 直接解压安装即可(附安装教程和解决无法安装问题)

    MySQL是世界上最受欢迎...总的来说,这个压缩包提供了一个完整的MySQL 5.5.56安装解决方案,包括了安装教程和问题解决策略,对于初次接触MySQL或需要在Windows 64位系统上部署数据库的人来说,这是一个非常有用的资源。

    mysql常用命令及mysql数据库安装使用手册.

    本手册旨在为用户提供MySQL数据库在Linux操作系统下的安装与使用指南,包括但不限于安装过程中的注意事项、常见问题解决方法以及基本操作命令等内容。 #### 第二章 MySQL安装 - **安装介质的获取** MySQL的安装...

    Powerdesigner中连接Mysql数据库.pdf

    为了解决这个问题,我们需要额外安装MyODBC,这是一个允许应用程序通过ODBC接口与MySQL进行通信的驱动程序。 MyODBC是MySQL官方提供的一个驱动程序,它为非MySQL原生的工具,如PowerDesigner,提供了与MySQL数据库...

    mysql-5.5.62-win32.msi数据库

    7. **日志功能**:MySQL 5.5提供了通用日志(general query log)和慢查询日志(slow query log),帮助开发者诊断性能问题,优化查询效率。 8. **内存优化**:MySQL 5.5改进了内存管理,减少内存碎片,提高了内存...

    MySQL GUI Tools 5.0-r16中文绿色版【可视化MySQL数据库控制台】

    MySQL GUI Tools 5.0-r16是一款专为MySQL数据库设计的强大图形用户界面工具,它提供了全面的可视化界面,使得数据库管理和操作变得更加直观和高效。这个中文绿色版特别适合那些不希望进行复杂安装过程或者需要在不同...

    mysql数据库安装包

    9. **版本兼容性**:虽然MySQL 5.0.15对Win7和XP系统是兼容的,但较新的系统可能会遇到一些问题。考虑升级到更现代的版本,如8.0,以获取更好的性能和安全性。 10. **社区支持**:MySQL作为开源项目,拥有强大的...

    MYSQL win7 x 64位版本

    标题"MYSQL win7 x 64位版本"指的是这个软件包是专门为运行在64位Windows 7系统上的MySQL数据库设计的。 描述中提到"MYSQL win7 x 64位版本,亲试,可以放心正常使用,分享之",意味着发布者已经亲自测试过这个...

    mysql win732位

    对于那些在技术学习道路上遇到困难的初学者来说,"mysql win7 32位"的安装包无疑是一个宝贵的资源。 在Windows 7 32位系统上安装MySQL,你需要确保你的计算机满足最低硬件要求,通常包括至少1GB的内存和足够的硬盘...

    mysql-5.5.36-win32.rar

    总的来说,"mysql-5.5.36-win32.rar"提供了一个在Windows环境中运行MySQL数据库的完整环境,包含了从安装到日常管理所需的全部组件。对于开发者和管理员来说,理解其工作原理和使用方法是至关重要的。

    mysql5.5.27_win64.zip

    总的来说,MySQL 5.5.27_win64.zip 提供了一个在 Windows 7 64 位环境下运行的高效、可靠的数据库解决方案,适用于各种规模的应用场景。无论是开发者还是管理员,都可以借助这个版本的 MySQL 实现数据的高效存储和...

    连接mysql数据库时要用到的odbc

    7. **兼容性**:ODBC驱动需要与MySQL服务器版本兼容,否则可能会出现连接问题。确保驱动的版本与MySQL服务器版本相匹配。 8. **错误处理**:当连接或查询失败时,ODBC驱动会返回错误代码和消息,帮助开发者诊断问题...

    MySQL ODBC 5.1.9-win32驱动

    MySQL ODBC 5.1.9-win32驱动是MySQL数据库管理系统与Windows操作系统之间的一个重要接口,它允许应用程序通过开放数据库连接(ODBC)标准来访问MySQL数据源。ODBC是一种标准化的技术,使得不同的数据库系统可以被...

    mysql5.1.49

    - MySQL是一个ACID(原子性、一致性、隔离性、持久性)兼容的数据库系统,支持SQL标准,并提供了多种存储引擎,如InnoDB、MyISAM、MEMORY等。 - 版本5.1是MySQL的一个里程碑,它引入了许多新特性,包括更好的事务...

Global site tag (gtag.js) - Google Analytics