Home > Database > Mysql Tutorial > How to Switch from MariaDB to MySQL with XAMPP on Windows?

How to Switch from MariaDB to MySQL with XAMPP on Windows?

Barbara Streisand
Release: 2024-11-12 20:52:02
Original
970 people have browsed it

How to Switch from MariaDB to MySQL with XAMPP on Windows?

Switch from MariaDB to MySQL with XAMPP on Windows

Background:

Despite searching the web, you have encountered difficulties finding a solution to replace MariaDB with MySQL in your XAMPP setup. This may be due to compatibility concerns with MySQL Workbench or prior attempts to upgrade MySQL to MariaDB that resulted in issues.

Solution:

Here is a detailed step-by-step guide on how to integrate MySQL into XAMPP on Windows, ensuring a successful conversion for both MySQL versions 8.0.18 and 5.7.28.

  1. Stop MariaDB: Use the XAMPP Control Panel to stop the currently running MySQL (MariaDB).
  2. Download MySQL: Retrieve the MySQL Community Server as a zip archive for Windows 64-bit systems.
  3. Rename MariaDB Directory: Rename the "mysql" directory within XAMPP to "mariadb."
  4. Extract MySQL: Extract the downloaded zip archive into the "mysql" directory inside XAMPP.
  5. Copy Configuration File: Transfer the file "my.ini" from the MariaDB bin directory to the MySQL bin directory.
  6. Edit Configuration File: Open "my.ini" in an editor and comment out the line beginning with "key_buffer=" within the "[mysqld]" section.
  7. Initialize MySQL: Perform the following commands in a command prompt:

    • 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
    Copy after login
    • 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
    Copy after login
  8. Start Services: Start both Apache and MySQL using the XAMPP Control Panel.
  9. Verify Configuration: Visit "http://localhost/phpmyadmin" to confirm that the database server is now recognized as MySQL Community Server.

Additional Notes:

Some key differences between MariaDB and MySQL to be aware of:

  • MySQL follows a stricter SQL standard compared to MariaDB, which may lead to compatibility issues if certain features are used.
  • MySQL provides better documentation and support, as it is the original implementation of the MySQL database system.

The above is the detailed content of How to Switch from MariaDB to MySQL with XAMPP on Windows?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template