How to connect to mysql after installing LEMP using PHP in web [duplicate]

49
February 11, 2019, at 4:50 PM

This question already has an answer here:

  • MySQL ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (using password: YES) 32 answers
  • Access denied for user 'username'@'localhost' (using password: YES) in C:\webdev\wamp\www\membershipSite\classes\Mysql.php on line 9 2 answers

This is not a duplicate to this question MySQL ERROR 1045 (28000): Access denied for user 'bill'@'localhost' (using password: YES)

I can access mysql using (mysql -u myself -p) in the command line of ubuntu server.

however when I create a php file and try to access the database in the webpage I get this error Access denied for user 'lds'@'localhost' (using password: YES) again this is not the same question as above, as his/her question is that they cant access mysql in the command line.

I followed this tutorial to install LEMP https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-ubuntu-18-04

I think the problem is that I should be pointing to another Ip address other than 'user'@'localhost'?

PHP:

$mysqlSever = "localhost";
$username = "****";
$pass = "*******";
$con =  mysqli_connect($mysqlSever, $username, $pass, "****") or die("not connect". mysqli_connect_error());

If I change $mysqlserver to my dns hostname I get error Connection refused

READ ALSO
How to use chr() function in an array for cleaning strings from dangereous characters in PHP?

How to use chr() function in an array for cleaning strings from dangereous characters in PHP?

Hi everyone i was working on some php formsI am a newbie so i might used a really annoying way to solve my problem

22
Show concrete data of array with objects [duplicate]

Show concrete data of array with objects [duplicate]

This question already has an answer here:

24
No styling when converting DOCX into PDF

No styling when converting DOCX into PDF

I am trying to convert a DOCX file to PDF with PHPWordWhen I execute the script it looks like that some style elements are not converted

21
Connection Failed: php_network_getaddresses: getaddrinfo failed: No such host is known

Connection Failed: php_network_getaddresses: getaddrinfo failed: No such host is known

Warning: mysqli_connect(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: No such host is knownin C:\xampp\htdocs\Hostel-Management-System-master\includes\config

29