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

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS PostgreSQL,高可用系列 2核4GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介: 有的win7版本可以和mysql兼容,可以很容易安装上去。但有的版本不行。 我之前的win7上装不了mysql5.0,但可以装上mysql5.1。但是我重装了新的win7之后就都装不上去了。我试了四五个版本,装了不下10次,但每一次都是最后一步卡住了。

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


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


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


 方法如下:


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


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

Java代码  
[client]  
#password   = your_password  
port        = 3306  
socket      = /tmp/mysql.sock  
[WinMySQLadmin]   
Server=C:/MySQL/MySQL_Server_5.0/bin/mysqld-nt.exe  
# Here follows entries for some specific programs  
# The MySQL server  
[mysqld]  
port        = 3306  
#Path to installation directory. All paths are usually resolved relative to this.  
basedir="C:/MySQL/MySQL_Server_5.0/"  
#Path to the database root  
datadir="C:/MySQL/MySQL_Server_5.0/data"  
# The default character set that will be used when a new schema or table is  
# created and no character set is defined  
default-character-set=utf8  
socket      = /tmp/mysql.sock  
skip-locking  
key_buffer = 256M  
max_allowed_packet = 1M  
table_cache = 256  
sort_buffer_size = 1M  
read_buffer_size = 1M  
read_rnd_buffer_size = 4M  
myisam_sort_buffer_size = 64M  
thread_cache_size = 8  
query_cache_size= 16M  
# Try number of CPU's*2 for thread_concurrency  
thread_concurrency = 8  
# Don't listen on a TCP/IP port at all. This can be a security enhancement,  
# if all processes that need to connect to mysqld run on the same host.  
# All interaction with mysqld must be made via Unix sockets or named pipes.  
# Note that using this option without enabling named pipes on Windows  
# (via the "enable-named-pipe" option) will render mysqld useless!  
#   
#skip-networking  
# Replication Master Server (default)  
# binary logging is required for replication  
log-bin=mysql-bin  
# required unique id between 1 and 2^32 - 1  
# defaults to 1 if master-host is not set  
# but will not function as a master if omitted  
server-id   = 1  
# Replication Slave (comment out master section to use this)  
#  
# To configure this host as a replication slave, you can choose between  
# two methods :  
#  
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -  
#    the syntax is:  
#  
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,  
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;  
#  
#    where you replace <host>, <user>, <password> by quoted strings and  
#    <port> by the master's port number (3306 by default).  
#  
#    Example:  
#  
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,  
#    MASTER_USER='joe', MASTER_PASSWORD='secret';  
#  
# OR  
#  
# 2) Set the variables below. However, in case you choose this method, then  
#    start replication for the first time (even unsuccessfully, for example  
#    if you mistyped the password in master-password and the slave fails to  
#    connect), the slave will create a master.info file, and any later  
#    change in this file to the variables' values below will be ignored and  
#    overridden by the content of the master.info file, unless you shutdown  
#    the slave server, delete master.info and restart the slaver server.  
#    For that reason, you may want to leave the lines below untouched  
#    (commented) and instead use CHANGE MASTER TO (see above)  
#  
# required unique id between 2 and 2^32 - 1  
# (and different from the master)  
# defaults to 2 if master-host is set  
# but will not function as a slave if omitted  
#server-id       = 2  
#  
# The replication master for this slave - required  
#master-host     =   <hostname>  
#  
# The username the slave will use for authentication when connecting  
# to the master - required  
#master-user     =   <username>  
#  
# The password the slave will authenticate with when connecting to  
# the master - required  
#master-password =   <password>  
#  
# The port the master is listening on.  
# optional - defaults to 3306  
#master-port     =  <port>  
#  
# binary logging - not required for slaves, but recommended  
#log-bin=mysql-bin  
# Point the following paths to different dedicated disks  
#tmpdir     = /tmp/       
#log-update     = /path-to-dedicated-directory/hostname  
# Uncomment the following if you are using BDB tables  
#bdb_cache_size = 64M  
#bdb_max_lock = 100000  
# Uncomment the following if you are using InnoDB tables  
#innodb_data_home_dir = /usr/local/var/  
#innodb_data_file_path = ibdata1:10M:autoextend  
#innodb_log_group_home_dir = /usr/local/var/  
#innodb_log_arch_dir = /usr/local/var/  
# You can set .._buffer_pool_size up to 50 - 80 %  
# of RAM but beware of setting memory usage too high  
#innodb_buffer_pool_size = 256M  
#innodb_additional_mem_pool_size = 20M  
# Set .._log_file_size to 25 % of buffer pool size  
#innodb_log_file_size = 64M  
#innodb_log_buffer_size = 8M  
#innodb_flush_log_at_trx_commit = 1  
#innodb_lock_wait_timeout = 50  
[mysqldump]  
quick  
max_allowed_packet = 16M  
[mysql]  
no-auto-rehash  
# Remove the next comment character if you are not familiar with SQL  
#safe-updates  
[isamchk]  
key_buffer = 128M  
sort_buffer_size = 128M  
read_buffer = 2M  
write_buffer = 2M  
[myisamchk]  
key_buffer = 128M  
sort_buffer_size = 128M  
read_buffer = 2M  
write_buffer = 2M  
[mysqlhotcopy]  
interactive-timeout  

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


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


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


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


新建一个文件:start_SQLServer.bat


内容如下

Java代码  
@ECHO OFF  
if exist "%cd%\my.ini" goto startsrv  
for /f %%i in ('net start') do if %%i==MySQL goto MySQL_IsRunning  
 goto MySQL_NotRunning  
:MySQL_IsRunning  
 echo "found Server!"  
相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
MySQL数据库入门学习
本课程通过最流行的开源数据库MySQL带你了解数据库的世界。 &nbsp; 相关的阿里云产品:云数据库RDS MySQL 版 阿里云关系型数据库RDS(Relational Database Service)是一种稳定可靠、可弹性伸缩的在线数据库服务,提供容灾、备份、恢复、迁移等方面的全套解决方案,彻底解决数据库运维的烦恼。 了解产品详情:&nbsp;https://www.aliyun.com/product/rds/mysql&nbsp;
相关文章
|
关系型数据库 MySQL Python
python安装MySQL-python:EnvironmentError解决办法
python安装MySQL-python:EnvironmentError解决办法
135 1
|
SQL 关系型数据库 MySQL
MySQL5.7 group by新特性报错1055的解决办法
MySQL5.7 group by新特性报错1055的解决办法
228 0
|
SQL 数据库 数据安全/隐私保护
SQL Server数据库Owner导致事务复制log reader job无法启动的解决办法
【8月更文挑战第14天】解决SQL Server事务复制Log Reader作业因数据库所有者问题无法启动的方法:首先验证数据库所有者是否有效并具足够权限;若非,使用`ALTER AUTHORIZATION`更改为有效登录名。其次,确认Log Reader使用的登录名拥有读取事务日志所需的角色权限。还需检查复制配置是否准确无误,并验证Log Reader代理的连接信息及参数。重启SQL Server Agent服务或手动启动Log Reader作业亦可能解决问题。最后,审查SQL Server错误日志及Windows事件查看器以获取更多线索。
177 0
|
关系型数据库 MySQL
mysql中有大量sleep进程的原因与解决办法
mysql中有大量sleep进程的原因与解决办法
1056 0
|
数据采集 中间件 关系型数据库
Mac系统通过brew安装mysql5.7后,启动报错的解决办法
Mac系统通过brew安装mysql5.7后,启动报错的解决办法
891 2
|
SQL 关系型数据库 MySQL
MySQL异常一之: You can‘t specify target table for update in FROM clause解决办法
这篇文章介绍了如何解决MySQL中“不能在FROM子句中指定更新的目标表”(You can't specify target table for update in FROM clause)的错误,提供了错误描述、需求说明、错误做法和正确的SQL写法。
2250 0
|
关系型数据库 MySQL
MySQL 8.0 - Authentication plugin ‘caching_sha2_password‘ cannot be loaded 原因及解决办法
MySQL 8.0 - Authentication plugin ‘caching_sha2_password‘ cannot be loaded 原因及解决办法
383 1
|
SQL 关系型数据库 MySQL
问题1:Navicat连接不上mysql8的简单解决办法
问题1:Navicat连接不上mysql8的简单解决办法
2327 2
|
关系型数据库 MySQL Linux
【Linux】安装Mysql(附加service mysql启动失败 提示unit not found 解决办法)
【Linux】安装Mysql(附加service mysql启动失败 提示unit not found 解决办法)
1035 0
|
关系型数据库 MySQL 索引
mysql索引失效的原因以及解决办法
该内容列举了索引失效的五个原因,包括:条件表达式中的函数使用、不等于操作符、列类型不匹配、LIKE操作的模糊匹配和数据量过小。并提供了对应的解决办法:避免函数操作索引列、使用合适条件、保证类型匹配、选择合适索引、优化表结构和使用索引提示。
1089 1

推荐镜像

更多