tushar9xx Posted June 15, 2010 Share Posted June 15, 2010 Hi I am very new in PHP programming. I am having problem with connecting mysql database. My web browser is showing me the following errors: Warning: mysql_connect(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for '1.0/DST' instead in E:\Program Files\Apache Software Foundation\Apache2.2\htdocs\what.php on line 4 Warning: mysql_connect(): [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in E:\Program Files\Apache Software Foundation\Apache2.2\htdocs\what.php on line 4 Warning: mysql_connect(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for '1.0/DST' instead in E:\Program Files\Apache Software Foundation\Apache2.2 \htdocs\what.php on line 4 Warning: mysql_connect(): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in E:\Program Files\Apache Software Foundation\Apache2.2\htdocs\what.php on line 4 Warning: main(): It is not safe to rely on the system's timezone settings. You are *required* to use the date. timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for '1.0/DST' instead in E:\Program Files\Apache Software Foundation \Apache2.2\htdocs\what.php on line 5 Fatal error: Maximum execution time of 30 seconds exceeded in E:\Program Files\ Apache Software Foundation\Apache2.2\htdocs\what.php on line 5 i used these codes:<?php ini_set('display_errors', 'on'); error_reporting(E_ALL); mysql_connect(); ?> I tried few methods like adding in php.ini [Date] ; Defines the default timezone used by the date functions date.timezone = Europe/London and In a DOS shell : >mysqld --standalone --timezone=GMT But can't solve the problem. My web server and mysql server is working properly. Need help.........................Someone please!!!! Oh i live in london and my system: OS: windows server 2008 standard X86 Apache 2.2 PHP 5.3.2 MySQL Quote Link to comment https://forums.phpfreaks.com/topic/204873-hi-need-help/ Share on other sites More sharing options...
B0b Posted June 15, 2010 Share Posted June 15, 2010 Connecting to your mySQL database is done this way: $dbUser = 'your_database_username'; $dbPass = 'your_database_password'; $database = 'your_database_name'; $dbCon = mysql_connect( 'localhost', $dbUser, $dbPass ); mysql_select_db( $database, $dbCon ); You should refer to this: http://www.w3schools.com/php/php_mysql_connect.asp Quote Link to comment https://forums.phpfreaks.com/topic/204873-hi-need-help/#findComment-1072680 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.