473,748 Members | 3,697 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Connect to MySQL

Hi,

PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a
problem with this simple code:

<?php
$link = mysql_connect(" 127.0.0.1",""," ")
or die("Could not connect: " . mysql_error());
echo "Connected successfully";
mysql_close($li nk);
?>

And this error occurs:

Warning: mysql_connect() : Can't connect to MySQL server on '127.0.0.1'
(10061) in C:\usr\Apache2\ htdocs\friko.pl \index.html on line 18
Could not connect: Can't connect to MySQL server on 'localhost' (10061)

The settings are:

Active Persistent Links 0
Active Links 0
Client API version 3.23.49

Directive Local Value Master Value
mysql.allow_per sistent On/On
mysql.connect_t imeout 60/60
mysql.default_h ost localhost/localhost
mysql.default_p assword no value/no value
mysql.default_p ort no value/no value
mysql.default_s ocket no value/no value
mysql.default_u ser no value/no value
mysql.max_links Unlimited/Unlimited
mysql.max_persi stent Unlimited/Unlimited
mysql.trace_mod e Off/Off

Thanks for any hints :--|

--
pozdr. Dygi [GG 1027078]
dygimail(at)poc zta(dot)fm
Jul 17 '05 #1
20 4820
On 2004-02-04, Mr Dygi <dy********@SPA Mpoczta.fm> wrote:
Hi,

PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a
problem with this simple code:

<?php
$link = mysql_connect(" 127.0.0.1",""," ")
or die("Could not connect: " . mysql_error());
echo "Connected successfully";
mysql_close($li nk);
?>

And this error occurs:

Warning: mysql_connect() : Can't connect to MySQL server on '127.0.0.1'
(10061) in C:\usr\Apache2\ htdocs\friko.pl \index.html on line 18
Could not connect: Can't connect to MySQL server on 'localhost' (10061)

Have you installed mysql? and is it running?

--
http://home.mysth.be/~timvw
Jul 17 '05 #2
Tim Van Wassenhove <eu**@pi.be> wrote in news:bvqth6$vnk 5c$2@ID-
188825.news.uni-berlin.de:
Have you installed mysql? and is it running?


Here I have another problem. I think, yes. I have installed MyODB 3.51.06
fo Windows with small configure problems. I have done this with
instructions from MyQSL Reference Manual for version 4.0.5 chapter 8.3.1
and 8.3.2.

But I'am not sure I should execute these section:

* To make a connection to a Unix box from a Windows box, with an ODBC
application (one that doesn't support MySQL natively), you must first
install MyODBC on the Windows machine.
* The user and Windows machine must have the access privileges to the MySQL
server on the Unix machine. This is set up with the GRANT command. See
section 4.3.1 GRANT and REVOKE Syntax.
+ You must create an ODBC DSN entry as follows:
+ Open the Control Panel on the Windows machine.
+ Double-click the ODBC Data Sources 32-bit icon.
+ Click the tab User DSN.
+ Click the button Add.
+ Select MySQL in the screen Create New Data Source and click the Finish
button.
* The MySQL Driver default configuration screen is shown. See section 8.3.2
How to Fill in the Various Fields in the ODBC Administrator Program.
* Now start your application and select the ODBC driver with the DSN you
specified in the ODBC administrator

I have done the section but something is still wrong. I can do some screen-
prints to show You what I have done, if you need to see it.

ps
I think I have some mistakes done about installing and configuring MyODBC.

--
pozdr. Dygi [GG 1027078]
dygimail(at)poc zta(dot)fm
Jul 17 '05 #3
On 2004-02-04, Mr Dygi <dy********@SPA Mpoczta.fm> wrote:
Tim Van Wassenhove <eu**@pi.be> wrote in news:bvqth6$vnk 5c$2@ID-
188825.news.uni-berlin.de:
Have you installed mysql? and is it running?


Here I have another problem. I think, yes. I have installed MyODB 3.51.06
fo Windows with small configure problems. I have done this with
instructions from MyQSL Reference Manual for version 4.0.5 chapter 8.3.1
and 8.3.2.


I'm not sure, but i think MyODB provides a driver to let ODBC talk with
your MySQL server.

Thus my question remains: Have you installed mysql server? and is it
running? :)

--
http://home.mysth.be/~timvw
Jul 17 '05 #4
"Mr Dygi" <dy********@SPA Mpoczta.fm> wrote in message
news:Xn******** *************** *******@127.0.0 .1...
$link = mysql_connect(" 127.0.0.1",""," ")


Make sure that your MySQL is running and does have the user with no-name and
no-password.

Jul 17 '05 #5
Tim Van Wassenhove <eu**@pi.be> wrote in news:bvrb4s$v7e q1$2@ID-
188825.news.uni-berlin.de:
I'm not sure, but i think MyODB provides a driver to let ODBC talk with
your MySQL server.
Thus my question remains: Have you installed mysql server? and is it
running? :)


Oh noooo... What a stupid. I was reading too fast and misunderstand the
text: "Note that MySQL and ODBC support is now built in, so no dll is
needed for it." from php package. I thought it is included like a module or
sth like that :--|

Ok. I've found it. Is this correct file:

http://www.mysql.com/get/Downloads/M...mysql-3.23.58-
win.zip/from/ftp://sunsite.icm.edu .pl/pub/unix/mysql/

About 13MB ;--[

--
pozdr. Dygi [GG 1027078]
dygimail(at)poc zta(dot)fm
Jul 17 '05 #6
Tim Van Wassenhove <eu**@pi.be> wrote in news:bvrb4s$v7e q1$2@ID-
188825.news.uni-berlin.de:
I'm not sure, but i think MyODB provides a driver to let ODBC talk with
your MySQL server.


You were right. I didn't have SQL Server installed. I have found 3.21.29a -
for win95 version on the CD form one of the old PC Magazines. I hope it
will not be a very problemous software (version) becasuse of my WinXP ;--)

I am newbie so i don't need very new functions of the sql database. What
you think?

ps
Thanks. You've pointed me in right direction.

--
pozdr. Dygi [GG 1027078]
dygimail(at)poc zta(dot)fm
Jul 17 '05 #7
In message <Xn************ *************** ***@127.0.0.1>, Mr Dygi
<dy********@SPA Mpoczta.fm> writes
You were right. I didn't have SQL Server installed. I have found
3.21.29a - for win95 version on the CD form one of the old PC
Magazines. I hope it will not be a very problemous software (version)
becasuse of my WinXP ;--)
This is a very old release - they MySQL site is recommending V4.1 for
new developments. On XP (and 2K & NT) it runs as a service (starts
automatically when the PC boots) which is probably what you want. I am
not using ODBC to connect to it on my PC either - presumably the PHP
functions are picking up information in the configuration file which
includes which TCP port to communicate with the server on.

I am newbie so i don't need very new functions of the sql database.
What you think?


I do think you should use an up-to-date version. You don't have to get
very far with SQL to find you want some of the features in it that are
not in 3.21 such as subqueries. I also wish that Informix had 'CREATE
TABLE x LIKE y'.

Lots more at:

http://www.mysql.com/doc/en/Nutshell_4.1_features.html
--
Five Cats
Email to: cats_spam at uk2 dot net
Jul 17 '05 #8
Five Cats <ca*******@[127.0.0.1]> wrote in
news:Wt******** ******@[127.0.0.1]:
This is a very old release - they MySQL site is recommending V4.1 for
new developments. On XP (and 2K & NT) it runs as a service (starts
automatically when the PC boots) which is probably what you want.
Yes. I configured it as service. It works in system background.
I am
not using ODBC to connect to it on my PC either - presumably the PHP
functions are picking up information in the configuration file which
includes which TCP port to communicate with the server on.
Hm. I've installed MySQL as service (mysqld) so I think php is not using
this way to connect to MySQL. Right? How can I check it?
I do think you should use an up-to-date version. You don't have to get
very far with SQL to find you want some of the features in it that are
not in 3.21 such as subqueries.
Yes. Yesterday I read some tutorials and I saw this version have not some
basic feautures that later have.
http://www.mysql.com/doc/en/Nutshell_4.1_features.html


Thanks a lot. I've already started to download newer version.

--
pozdr. Dygi [GG 1027078]
dygimail(at)poc zta(dot)fm
Jul 17 '05 #9
In message <Xn************ *************** ***@127.0.0.1>, Mr Dygi
<dy********@SPA Mpoczta.fm> writes
Five Cats <ca*******@[127.0.0.1]> wrote in
news:Wt******* *******@[127.0.0.1]:
This is a very old release - they MySQL site is recommending V4.1 for
new developments. On XP (and 2K & NT) it runs as a service (starts
automatically when the PC boots) which is probably what you want.
Yes. I configured it as service. It works in system background.


Have you tested it by connecting & so on from a DOS box?
I am
not using ODBC to connect to it on my PC either - presumably the PHP
functions are picking up information in the configuration file which
includes which TCP port to communicate with the server on.
Hm. I've installed MySQL as service (mysqld) so I think php is not using
this way to connect to MySQL. Right? How can I check it?


It is connecting to the service through a TCP port, as specified in the
my.ini file. Of course it might depend on what PHP commands you are
using - I'm assuming you are using the specific MySQL ones (see
http://www.php.net/manual/en/ref.mysql.php). The entry for
mysql_connect makes it quite explicit it's connection via a TCP port
(the default is localhost:3306 but best see the manual page,
http://www.php.net/manual/en/functio...l-connect.php), but if you are
using the ODBC functions then you would need an appropriate ODBC driver
installed. There is a big assumption on my part here, which is that you
*can* use ODBC to access a MySQL database - it's not mentioned in the
manual (http://www.php.net/manual/en/ref.odbc.php) but I know there is a
driver and I've managed to use it to get data into Excel before now.
This could well be an assumption too far.
I do think you should use an up-to-date version. You don't have to get
very far with SQL to find you want some of the features in it that are
not in 3.21 such as subqueries.
Yes. Yesterday I read some tutorials and I saw this version have not some
basic feautures that later have.


;-)
http://www.mysql.com/doc/en/Nutshell_4.1_features.html


Thanks a lot. I've already started to download newer version.


The manuals (MySQL & PHP) might be a useful download as well if you
don't already have them!

--
Five Cats
Email to: cats_spam at uk2 dot net
Jul 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2409
by: Bill Hernandez | last post by:
Hi, I've been writing software on the mac since 1987, but am brand new at unix/php/mysql, and that's where I'm headed so I'm reading everything I can get my hands on, but like anything else there's going to be a learning curve, that having been said... I followed the install instructions at http://entropy.ch , and was able to get mySql & php installed on my G4 -> (OSX 10.2.6) last night. I downloaded Navicat and setup a password for...
0
9012
by: Ryan Stewart | last post by:
I'm running MySQL server on a WinXP box at home. I have a cable modem/router. I've set up port forwarding on port 3306 to the machine running MySQL. I can connect locally just fine, but when I try to connect from a remote location using: mysql -h xxx.xxx.xxx.xxx -P 3306 -u root -p mysql I get: ERROR 2003: Can't connect to MySQL server on 'xxx.xxx.xxx.xxx' (10061) When I try:
3
17808
by: Pugi! | last post by:
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get the following problem when connecting to mysql through a browser (phpMyAdmin): : #2002 Can't connect to local MySQL server through socket /var/lib/mysql/mysql.sock On the website of MySQL this error is mentioned but I found no solution. In /var/log/messages the following log occurs :
1
121535
by: jiing | last post by:
Now let me describe what I have done and my purpose: Originally, I want to user ports to install phpBB But I found that phpBB doesn't support mysql 5.x (but the ports installed mySQL 5.0.0 alpha) so I deinstall mysql5-server and mysql5-client And then I install mysql41-server and mysql41-client on FreeBSD 5.3 by ports but now , mysql is not workable
2
2745
by: xiuchuanli | last post by:
I install Fedora 4 with web server, after that I installed mysql 5.0.15. Now I can connect to mysql from command line and mysql-administrator and mysql-query-browser. But when I try to test to connect from php code, it told me that "can not connect to local mysql through /tmp/mysql.sock. /tmp/mysql.sock is my sock file to connect and permission is set good. when I add phpinfo() to my php code, it show me that mysql lib php uses is 4.1.X,...
0
1826
by: xiuchuanli | last post by:
I install Fedora 4 with web server, after that I installed mysql 5.0.15. Now I can connect to mysql from command line and mysql-administrator and mysql-query-browser. But when I try to test to connect from php code, it told me that "can not connect to local mysql through /tmp/mysql.sock. /tmp/mysql.sock is my sock file to connect and permission is set good. when I add phpinfo() to my php code, it show me that mysql lib php uses is 4.1.X,...
1
4510
by: linux | last post by:
Sorry if this is a really dumb question. I am trying to connect to our remote MySQL server (which is running just fine). I have a perl script which worked just fine on my other Fedora 4 box (all servers are Fedora 4 with latests updates). The one that worked fine it down and I cannot compare anything against it (it was a client also). My problem is, when I try to connect to the server I get:
2
22542
by: Martin | last post by:
Hi all. I have a fully functional page hosted on my PC that uses PHP and connects to MySQL on my PC to generate it's code. I now have some web hosting available which includes both PHP and MySQL support, however the webhost is still in the process of getting the MySQL support activated and functional. I therefore have uploaded my webpage to the host and edited the webpage
5
2634
by: scorpionbilli | last post by:
Hi, The local mysql server is running on my Macbook. I can access it through the console client: $ mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.0.45 MySQL Community Server (GPL)
0
8989
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.