Jump to content

Daniel On The Web

Members
  • Posts

    23
  • Joined

  • Last visited

About Daniel On The Web

  • Birthday 11/22/2000

Daniel On The Web's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Well, guess what: I contacted with the admin of the domain I'm using to create a database for me and tried to connect to it via PHP. And it worked. Anyway, thank you for all your help.
  2. As I thought I did something wrong, I decided to start over on a Mac. PHP works even without XAMPP, so I believe that the service to upload my webpage supports PHP. Now I'm thinking about reinstalling MySQL and phpMyAdmin in the Mac and test it again. Anyway, useful info to check what's the right port.
  3. There's one my.ini in the XAMPP MySQL \bin folder. There's also my-huge.ini, my-innodb-heavy-4G.ini, my-large.ini, my-medium.ini, my-small.ini in xampp\mysql. There's no my.cnf, however.
  4. User name: any Host name: localhost Password: no Global privileges: usage User group: - Grant: no User name: pma Host name: localhost Password: no Global privileges: usage User group: - Grant: no User name: root Host name: 127.0.0.1 Password: no Global privileges: all privileges User group: - Grant: yes User name: root Host name: ::1 Password: no Global privileges: all privileges User group: - Grant: yes User name: root Host name: localhost Password: no Global privileges: all privileges User group: - Grant: yes
  5. It appears to me as "Privileges", but I think it's the same. The user I tried to use to connect to the database is: User name: root Host name: localhost Type: global Privileges: ALL PRIVILEGES Grant: Yes
  6. With MySQLi: No connection could be made because the target machine actively refused it. With PDO: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it. So they are the same. The console works well. The problem is connecting to the databases using PHP. And I'm using a PC.
  7. I tried with MySQLi but got the same error. Actually I don't care about using PDO or MySQLi. I'm choosing what works best.
  8. Like this?: extension=php_pdo_mysql.dll Because that's how it appears on my php.ini. And it's not commented. I'm already using it.
  9. I checked the port it is using and it's 3306. But I still find the message that says me that the connection failed.
  10. Checked. It wasn't the firewall. Strange. Could I have to change some configuration file?
  11. Yes, I configure it but it doesn't work as it should. I admit that it's weird.
  12. Both "localhost" and "localhost:3306" didn't work as servers.
  13. Of course. I know that I shouldn't post such kind of information. However, I set up an user, a host and a password and wrote the same information in the PHP and the code is still throwing the error.
  14. I used Port 81 because I had to change it when preparing Apache. And the MySQL process was active.
  15. <?php $serv = "localhost:81"; $user = "root"; $password = ""; try { $con = new PDO("mysql:host=$serv;dbname=test", $user, $password); $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Successfully connected."; } catch (PDOException $e) { echo "Connection failed: " . $e->getMessage(); } ?> Here I'm trying to use PDO to connect to my SQL database "test". However, I receive this error each time I connect: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it. Am I connecting with the wrong server, user or password? Because I fail to see here the mistake.
×
×
  • Create New...