如何在 XAMPP 中将 MariaDB 更改为 MySQL?
A.第一件事:
- 先生谷歌没有帮助我找到对我的问题的任何答复以上
- 是的,我在这里阅读了相反问题的解决方案如何在 Windows 上 5 分钟内在 XAMPP 中将 MySQL 升级到 MariaDB(它对我没有帮助:MySQL 根本无法启动)
- 我不希望得到像MariaDB 更好,-停止你的愚蠢"这样的回复练习'.
- Mr. Google hasn't helped me to found any reply to my question above
- Yes, I have read a solution to the opposite question here How to upgrade MySQL to MariaDB in XAMPP in 5 minutes on Windows (and it hasn't helped me: MySQL simply doesn't start)
- I don't expect replies like 'MariaDB is better, - stop your silly exercises'.
B.我正在使用 MySQL Workbench,因此不希望现在或将来遇到任何不兼容问题.
B. I am working with MySQL Workbench and because of that don't want to face any incompatibilities either now or in future.
C.有人可以分享他们解决这个问题的经验(如果有的话)吗?
C. Can someone share their experience (if any) in solving this problem?
推荐答案
使用 MySQL 运行 XAMPP
以下是将 MySQL 真正集成到 Windows 上的 XAMPP 的准确分步说明.这已在 Windows 10 和 XAMPP 7.3.11 上成功测试,适用于 MySQL 8.0.18 和 5.7.28.
- 在 XAMPP 控制面板中停止 MySQL(实际上是 MariaDB).
- 将 MySQL 社区服务器下载为 zip 存档(Windows 64 位版本)
- 将
C:\xampp\mysql
重命名为C:\xampp\mariadb
- 将下载的 zip 压缩包解压到
C:\xampp\mysql
.确保您提取的文件夹级别包含子文件夹bin
、include
、lib
等. - 将
C:\xampp\mariadb\bin\my.ini
复制到C:\xampp\mysql\bin
- 在编辑器中打开
C:\xampp\mysql\bin\my.ini
并注释掉[mysqld] 中以
部分.key_buffer=
开头的行 打开命令提示符并运行以下命令:
- Stop MySQL (which actually is MariaDB) in the XAMPP Control Panel.
- Download the MySQL community server as zip archive (Windows 64 bit version)
- Rename
C:\xampp\mysql
toC:\xampp\mariadb
- Extract the downloaded zip archive to
C:\xampp\mysql
. Make sure you extract the folder level which has the subfoldersbin
,include
,lib
etc. - Copy
C:\xampp\mariadb\bin\my.ini
toC:\xampp\mysql\bin
- Open
C:\xampp\mysql\bin\my.ini
in an editor and comment out the line starting withkey_buffer=
in the[mysqld]
section. Open a command prompt and run the following commands:
对于 MySQL 8.0.18:
cd C:\xampp\mysql
bin\mysqld --initialize-insecure
start /b bin\mysqld
bin\mysql -u root
CREATE USER pma@localhost;
SOURCE C:/xampp/phpMyAdmin/sql/create_tables.sql;
GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON phpmyadmin.* TO pma@localhost;
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY '';
ALTER USER pma@localhost IDENTIFIED WITH mysql_native_password BY '';
\q
bin\mysqladmin -u root shutdown
对于 MySQL 5.7.28:
cd C:\xampp\mysql
bin\mysqld --initialize-insecure --log_syslog=0
start /b bin\mysqld --log_syslog=0
bin\mysql -u root
CREATE USER pma@localhost;
SOURCE C:/xampp/phpMyAdmin/sql/create_tables.sql;
GRANT SELECT, INSERT, DELETE, UPDATE, ALTER ON phpmyadmin.* TO pma@localhost;
\q
bin\mysqladmin -u root shutdown
在 XAMPP 控制面板中启动 Apache 和 MySQL.
Start Apache and MySQL in the XAMPP Control Panel.
相关文章