How To Test Mysql Database Connection
RegisterLogin
How To Test Mysql Database Connection
Post Description: Testing Mysql Database Script Will Help You To Test Your Connections Like Login Password To Check And Confirm Your Credentials Are Good
Tags: How, To, Test, Mysql, Database, Connection
This Post Was Posted On Dec 10, 2011 By Webune Tutorials #2690
Post Description: Testing Mysql Database Script Will Help You To Test Your Connections Like Login Password To Check And Confirm Your Credentials Are Good
Tags: How, To, Test, Mysql, Database, Connection
This Post Was Posted On Dec 10, 2011 By Webune Tutorials #2690
How To Test Mysql Database Connection by Webune Tutorials
Welcome to Webune Support Forums - We provide PHP hosting with MySQL database. Our support and service is unmatched. we are developers like you and we know what PHP developers needs.
Today we are sharing a very useful script written in php to test you database connection. this easy and simple to use script will help you confirm the login information you have been given it correct.
for example. lets say you have a script which uses a MySQL database, but you are getting connection errors like:
Access denied for user 'admin'@'localhost' (using password: NO)
this error simply means you dont have the correct database information like your username because the script tried to connect to your databse but it was unsuccessful.
if you dont want to download the script provided in this post, you can create the script yourself by following the steps provide on this post: Testing Mysql Database Connection Script
step 1. download the script provided in this post
step 2. unzip it and upload to your server where you have PHP and a MySQL database.
step 3. once you have uploaded to your site, test it by accessing the script to where you place it in your site. for example:
http://www.example.com/testmysql/test-mysql.php
please give us any comments or tips.
Thanks
Webune Support Team
UPDATE: after reading some of your replies, there are some of you that are having trouble because no errors show up. probably your PHP configuration is setup to hide errors, what you can do is add this line at the beginning of our script:
add this line:
ini_set('display_errors', 1);
this will ensure that if you have any errors, it will show up
Download File: testmysql.zip
Leave Your Comments
wilson
#9332 1
i tried with testmysql.php, result is good. but i still cannot connect.
pls advise
<?php
mysql_connec 'root', 'admin');
mysql_select_db
pls advise
<?php
mysql_connec 'root', 'admin');
mysql_select_db
Jan 05, 2012 Reply Report abuse
baljit
#9260 2
Thanks for testmysql.zip file
Dec 10, 2011 Reply Report abuse
prem
#5462 3
thanks for this........
Sep 21, 2011 Reply Report abuse
kunal
#5382 4
it gives lots of error while running.
please guide to me to run this script properly.
thanks
please guide to me to run this script properly.
thanks
Aug 14, 2011 Reply Report abuse
dwitesh
#5262 5
its very helpful
Jun 13, 2011 Reply Report abuse
Laurent
#5244 6
practically and very good example.
it's exactly what i need for db connection. thanks webune team
it's exactly what i need for db connection. thanks webune team
Jun 04, 2011 Reply Report abuse
John
#4897 7
i am getting undefined index errors in this script
Mar 10, 2011 Reply Report abuse
james
#4806 8
thanks for this tool, it worked.
Feb 04, 2011 Reply Report abuse
steve
#4618 9
great script. works like a charm.thanks
Nov 13, 2010 Reply Report abuse
zorrax
#4599 10
excellent
it is working
it is working
Nov 06, 2010 Reply Report abuse
bratok
#4496 11
thanks all cool working
Sep 30, 2010 Reply Report abuse
dimitrio
#4483 12
excellent! always got the msg "test mysql step 2".. changing the line mysql.default_host =localhost to mysql.default_host =127.0.0.1 from php.ini everything goes fine! in the browser you can keep localhost, eg: localhost/test2.php. thx a lot.
Sep 26, 2010 Reply Report abuse
PedroC
#4416 13
works perfect. excellent script.
Sep 06, 2010 Reply Report abuse
ram
#4411 14
yeah its working pals...!
Aug 31, 2010 Reply Report abuse
Alex
#4375 15
thank's for the script!
Aug 22, 2010 Reply Report abuse
View More Comments
Leave Your Comments...
©2012 Webune Forums - Thu Jan 05, 2012 8:43 am
Powered by: Webune Forums V3
Powered by: Webune Forums V3