Jump to content

Hazak

Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Maringa PR Brazil

Hazak's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Root Admin: When I run the new conn.php script (changing user name to "hazak_remcon") in my www heliohost.org directory (using localhost as host), I got the same success result. Thanks for support.
  2. The Root Admin recommendation works remotely from my Wampserver php script. (user name prefix) Now I´m going to test running directly on my heliohost.org www directory. I hope there will be no problem. Thanks mates.
  3. sagnik: I did conn.php modification as you recommended. Basically I got the same result and no new clue was showed, as follows: ( ! ) Warning: mysqli_connect(): (HY000/1045): Access denied for user 'remcon'@'179.157.27.166' (using password: YES) in C:\wamp64\www\conn_remx1.php on line 6 Call Stack # Time Memory Function Location 1 0.0007 235624 {main}( ) ...\conn_remx1.php:0 2 0.0007 236424 mysqli_connect ( ) ...\conn_remx1.php:6 ( ! ) Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in C:\wamp64\www\conn_remx1.php on line 11 Call Stack # Time Memory Function Location 1 0.0007 235624 {main}( ) ...\conn_remx1.php:0 2 5.3416 237160 mysqli_error ( ) ...\conn_remx1.php:11 connection not success:
  4. Sagnik, yes the database was crested by "hazak" user (cpanel admin) but I added "remcon" as DB user and set all access rights as I said before.
  5. I'm testing a remote connection to my Mysql DB and table. I followed the basic procedure: 1 - I created DB ("employee101") by Mysql wizard. 2 - I created employee_data table by Myphpdamin. 3 - I created two DB users ("hazak" (cpanel user) and "remcon". 4 - I set users access and rights to "employee101" DB. 5 - I built two PHP scripts to remotely access Db and table, and put them in "hazak" public_html directory, as follows: 1 - conn.php (connection): <?php$db_name = "hazak_employee101";$mysql_username = "hazak";//$mysql_username = "remcon";//$mysql_password = "&cx=Q******";$mysql_password = "al********";$server_name = "localhost:3306";$conn = mysqli_connect($server_name, $mysql_username, $mysql_password, $db_name);if($conn){echo "connection success";}else{echo "connection not success";}?> 2 - login.php (login): <?php require "conn.php";$user_name = $_POST["user_name"];$user_pass = $_POST["password"];$mysql_qry = "select * from employee_data where username like '$user_name' and password like '$user_pass';";$result = mysqli_query($conn, $mysql_qry);if(mysqli_num_rows($result) > 0){$row = mysqli_fetch_assoc($result);$name = $row["name"]; echo "login success - user ".$name;}else{echo "login not success";}mysqli_close($conn)?> 6 - Remotely run the script. First using "hazak" user set in conn.php and second, using "remcon" user in the same script. I got the same error message (bellow) and when I created an email acoount to "hazak" (cpanel) user the message gone away and I could remotely connect to DB and access "employee_data" table. but the same didn't happened to the "remcon" user. Since I could't find reference to this error on heliohost.org Mysql pages I´m not sure about what is the error cause. Can anybody tell the possible cause/solution for this error and help me? Error message: Warning: mysqli_connect(): (HY000/1045): Access denied for user 'remcon'@'localhost' (using password: YES) in /home/hazak/public_html/remcon/conn.php on line 8
×
×
  • Create New...