如何在 XAMPP 中将 MariaDB 更改为 MySQL?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39654428/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I change MariaDB to MySQL in XAMPP?
提问by Mike
A. First things first:
A. 第一件事:
- 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'.
- 谷歌先生没有帮助我找到对上述问题的任何答复
- 是的,我在这里阅读了一个解决相反问题的解决方案 如何在 Windows 上的 5 分钟内在 XAMPP 中将 MySQL 升级到 MariaDB(它没有帮助我:MySQL 根本无法启动)
- 我不期望像“MariaDB 更好,停止你的愚蠢练习”这样的回复。
B. I am working with MySQL Workbench and because of that don't want to face any incompatibilities either now or in future.
B. 我正在使用 MySQL Workbench,因此现在或将来都不想面对任何不兼容问题。
C. Can someone share their experience (if any) in solving this problem?
C. 有人可以分享他们解决这个问题的经验(如果有的话)吗?
回答by Code
You can use the following way.
您可以使用以下方式。
- Stop MariaDB in Xampp which show as mysql running...
- Download the installer for windows mysql Installer
- Follow the instruction.
- Now start Apache2 and clear cookie in your browser. Now you can see phpmyadmin and workbench showing Server type: MySQL
- 在 Xampp 中停止 MariaDB,显示 mysql 正在运行...
- 下载 windows mysql Installer 的安装程序
- 按照说明操作。
- 现在启动 Apache2 并清除浏览器中的 cookie。现在您可以看到 phpmyadmin 和 workbench 显示服务器类型:MySQL
If you want to stick to MariaDBthen you can use sqlyog also.
如果您想坚持使用MariaDB,那么您也可以使用 sqlyog。
Hope it answer your question
希望它能回答你的问题
回答by emkey08
Running XAMPP with MySQL
使用 MySQL 运行 XAMPP
Here are exact step by step instructions for truly integrating MySQL into XAMPP on Windows. This has been successfully tested with Windows 10 and XAMPP 7.3.11 for both MySQL 8.0.18and 5.7.28.
以下是将 MySQL 真正集成到 Windows 上的 XAMPP 的确切分步说明。这已在 Windows 10 和 XAMPP 7.3.11 上成功测试,适用于 MySQL 8.0.18和5.7.28。
- Stop MySQL (which actually is MariaDB) in the XAMPP Control Panel.
- Download the MySQL community serveras 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:
For 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
For 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
Start Apache and MySQL in the XAMPP Control Panel.
- Go to http://localhost/phpmyadminand verify that your database server is now reported as
MySQL Community Server
.
- 在 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
在编辑器中打开并注释掉部分key_buffer=
中以开头的行[mysqld]
。打开命令提示符并运行以下命令:
对于 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。
- 转到http://localhost/phpmyadmin并验证您的数据库服务器现在是否报告为
MySQL Community Server
.
回答by ARUN Madathil
You have to do little adjustment with xampp in order to use MySQL instead of MariaDB . I just did following and its worked , i think it may helpful to others also.
您必须对 xampp 进行少量调整才能使用 MySQL 而不是 MariaDB 。我只是跟随它并且它起作用了,我认为它也可能对其他人有帮助。
- Download and install mysql installer.
- 下载并安装 mysql 安装程序。
2.stop xampp and rename the mysql folder inside the xampp directory(may be its not necessary! )
2.停止xampp并重命名xampp目录中的mysql文件夹(可能没有必要!)
3.just start Apache only from xampp control panel . No need to start mysql.
3. 仅从 xampp 控制面板启动 Apache。无需启动mysql。
4.Last step . Make sure your running MySQL in your system . That's it ..
4.最后一步。确保您的系统中正在运行 MySQL。就是这样 ..
Check php admin panel there you can see Server type: MySQL
instead of MariaDB ...
检查 php 管理面板,您可以看到Server type: MySQL
而不是 MariaDB ...
Thanks..
谢谢..
回答by Manfred
I just upgraded XAMPP because of PHP 7. I am also using mysql workbench. I want to be as close to production as I can, but my webhoster supports only mysql. These where my reasons to switch back from mariadb to mysql
由于 PHP 7,我刚刚升级了 XAMPP。我也在使用 mysql 工作台。我想尽可能接近生产,但我的网络主机只支持 mysql。这些是我从 mariadb 切换回 mysql 的原因
I followed these steps: (also max 5min) https://gist.github.com/odan/c799417460470c3776ffa8adce57eece
我按照以下步骤操作:(也最多 5 分钟) https://gist.github.com/odan/c799417460470c3776ffa8adce57eece