添加多个版本的mysql或同时运行多个mysql服务。
修改每个mysql目录下的my.ini文件配置,主要是端口和目录。
# For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7.28/en/server-configuration-defaults.html # *** DO NOT EDIT THIS FILE. It's a template which will be copied to the # *** default location during install, and will be replaced if you # *** upgrade to a newer version of MySQL. [mysqld] # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. basedir = D:\Java\mysql-5.7.29-winx64\mysql-5.7.29-winx64 datadir = D:\Java\mysql-5.7.29-winx64\mysql-5.7.29-winx64\data #skip-grant-tables port = 3307 server_id = 1
一、注册服务
mysqld --install mysql5.7
mysqld --defaults-file=F:\mysql-5.7\my.ini --initialize --console
二、开启服务
net start mysql5.7
三、通过指定端口访问
mysql -uroot -p -P3307
这篇文档对您是否有帮助?