MySql & phpMyAdmin

I have an Open Server installed on my computer and use it to launch a web page from which data should be entered not in its database, but in a MySQL database that is also installed on my computer. And the data is still written to the database in phpmyadmin, which is installed on the Open Server. $mysql = new mysqli('localhost', 'root', 'root', 'a_db');

And this is the default phpmyadmin settings from Open Server. I only changed the port to 3307. Server: 127.0.0.1:3307 "Database: a_db "Table: aa

Author: maloi, 2020-06-14

1 answers

Option 1. In the script of the page in the connection function, specify the port of the database to which you want to write data. For example:

$mysql = new mysqli('localhost:3307', 'root', 'root', 'a_db');

Option 2. In the php settings in OpenServer, there is a line

mysqli.default_port = %mysqlport%

Replace it with

mysqli.default_port = 3307

And restart OpenServer. This option will affect all scripts running on OpenServer.

 0
Author: Gleb Oleynik, 2020-06-16 17:46:03