M
M
Maxim Evdokimov2021-06-23 22:24:51
PHP
Maxim Evdokimov, 2021-06-23 22:24:51

Connecting MySQL to PHP?

I write in PHP file:
$link = mysqli_connect('127.0.0.1', 'root', '123456', 'php_db');

On startup it gives an error:
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in C:\Openserver\...\index.php on line 26

perhaps this is due to the fact that I installed openserver and when I try to enable the mysql module, it gives an error: It is impossible to take port 3306 because it is already in use: c:\program files\mysql\mysql server 8.0\bin\mysqld.exe The only way

to solve the problem is to demolish installed mysql and use built-in openserver? Or are there other solutions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2021-06-23
@Maxevdo

Well, you have two muscles who want to occupy one port, you can change the port of the muscle in the settings in the open server, if you want to connect to the open server muscle, then use the port that you set and write in the connection

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question