Cant connect mysql
Posted by: dhanabal.pa (---.opera-mini.net)
Date: July 15, 2014 10:36PM

I am new on php. I installed wampserver on windows 7. When i try to open testmysql.php, it always show as: Could not connect to MySQL: php_network_getaddresses: getaddrinfo failed: No such host is known.
Pls give me solution for tis.
Thank you

Options: ReplyQuote
Re: Cant connect mysql
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: July 16, 2014 12:30AM

That file is not complete, its basically a blank for you to add 3 things to. It needs editing to add the domain and user and password, try this

<?php 
$link = mysql_connect('127.0.0.1','root',''); 
if (!$link) { 
	die('Could not connect to MySQL: ' . mysql_error()); 
} 
echo 'Connection OK'; mysql_close($link); 
?>


This stuff does require just a small amount of inteligence, its not a word processor you have just installed.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 07/16/2014 09:49AM by Otomatic.

Options: ReplyQuote
Re: Cant connect mysql
Posted by: dhanabal.pa (223.234.183.---)
Date: July 16, 2014 09:43AM

and i have another one doubt.
i create one database on mysql. its showing as

not able to connect:Accès refusé pour l'utilisateur: 'dbuser'@'@localhost' (mot de passe: OUI)

. what is the solution for this
thank you

Options: ReplyQuote
Re: Cant connect mysql
Posted by: dhanabal.pa (27.57.244.---)
Date: July 16, 2014 09:49AM

and what is the default dmain name,dbuser and dbpassword for mysql

Thank you

Options: ReplyQuote
Re: Cant connect mysql
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: July 16, 2014 12:13PM

All MySQL installations come with a default SUPERUSER account setup for you.

It is

Username = root
password = blank ( there is no password set.

Thats why I coded my answer like that !



As per the documentation 2.9.2 Securing the Initial MySQL Accounts


Also if you dont speak French, and I assume you dont as you are on the English site an not the French one, you can make a change so that MySQL reports in your own language.

Edit my.ini ( using the wampmanager menus ) wampmanager->MYSQL -> my.ini

Change
# Change your locale here !
lc-messages=fr_FR

To, for example get English errors messages from MYSQL

# Change your locale here !
lc-messages=en_GB




Reagarding the Access refused message:

Not sure if 'dbuser'@'@localhost' is a typo or an error setting up the account. As there should only be one @ sign in there

But I would guess that you created a user but did not give it access rights to your new database.


6.2 The MySQL Access Privilege System

phpMyAdmin user management

Google and the manual are a wonderful thing.

This stuff does require a small amount of reasearch, its not a word processor you have just installed. You now have 2 servers running on your system that would normally have at least one tecky per server who's sole job would be to manage that server Unfortunately you are at the bottom on a bit of a learning curve.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Cant connect mysql
Posted by: dhanabal.pa (223.177.252.---)
Date: July 16, 2014 02:03PM

thank you..

Options: ReplyQuote


Sorry, only registered users may post in this forum.