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
emmanuel
#10012 1
thanks soo much guys, the dB connection script came in handy for me when i was in the middel of a project and had no time to go back to my script to check where i was having the errors.
thank soo much and keep up the good work
thank soo much and keep up the good work
Oct 10, 2012 Reply Report abuse
Frank
#9728 2
I mjust be missing something, as it just keep getting 500 Sever Error. I added the line for errros printing, but didnot see any errors.
May 16, 2012 Reply Report abuse
teb
#9640 3
Thanks works great. Good job guys!
Apr 12, 2012 Reply Report abuse
Mushin
#9509 4
Works like a charm! Cheers
Feb 25, 2012 Reply Report abuse
wilson
#9332 5
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 6
Thanks for testmysql.zip file
Dec 10, 2011 Reply Report abuse
prem
#5462 7
thanks for this........
Sep 21, 2011 Reply Report abuse
kunal
#5382 8
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 9
its very helpful
Jun 13, 2011 Reply Report abuse
Laurent
#5244 10
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 11
i am getting undefined index errors in this script
Mar 10, 2011 Reply Report abuse
james
#4806 12
thanks for this tool, it worked.
Feb 04, 2011 Reply Report abuse
steve
#4618 13
great script. works like a charm.thanks
Nov 13, 2010 Reply Report abuse
zorrax
#4599 14
excellent
it is working
it is working
Nov 06, 2010 Reply Report abuse
bratok
#4496 15
thanks all cool working
Sep 30, 2010 Reply Report abuse
View More Comments
Leave Your Comments...
©2012 Webune Forums - Wed Oct 10, 2012 6:08 am
Powered by: Webune Forums V3
Powered by: Webune Forums V3