Professional Web Applications Themes

Connecting to MySql - PHP Development

I have installed MySql on a Windows 98 workstation. I start the service with the command: mysqld I can connect to the database and see tables, etc. I have installed Apache Ver 1.X with PHP ver 5.0.0b1 Simple PHP scripts work fine. When I try to connect to the Mysql database I get this error from PHP in my browser Fatal error: Call to undefined function: mysql_connect() in c:\program files\apache group\apache\htdocs\secretdb.php on line 30 With this version it is my understanding the MySql and ODBC support are internal to PHP and I do not have to enable Windows extensions within ...

  1. #1

    Default Connecting to MySql

    I have installed MySql on a Windows 98 workstation. I start the service
    with the command: mysqld

    I can connect to the database and see tables, etc.

    I have installed Apache Ver 1.X with PHP ver 5.0.0b1

    Simple PHP scripts work fine.

    When I try to connect to the Mysql database I get this error from PHP in my
    browser

    Fatal error: Call to undefined function: mysql_connect() in c:\program
    files\apache group\apache\htdocs\secretdb.php on line 30


    With this version it is my understanding the MySql and ODBC support are
    internal to PHP and I do not have to enable Windows extensions within the
    PHP.ini file.. Anyone have any idea on why this function seems to be
    undefined in PHP when it is internal? Should I download and install ver 4.x
    I have updated MDAC to ver 2.7.


    I am NEW to PHP, MySql and Apache and having fun!!!!!!

    Regards,
    Bob




    Bob Trautman Guest

  2. #2

    Default Connecting to mySQL

    I am having trouble connecting to mySQL on my remote server. I was wondering
    what I need to do to connect to mySQL server?

    Through several posts to this newsgroup I have decided to set my database up
    on my server as opposed to locally and work with it that way, but I am
    wondering if that means I will have to write all the code myself on
    Dreamweaver and then test it through the remote or if I can connect to it
    through the remote server and use the Application tools to set up my pages.

    Also I am using ipowerweb as my host so if anyone is using this and has been
    successful please let me know.

    Please help?!?!?

    Thanks

    Brad


    Brad Brevet Guest

  3. #3

    Default Re: Connecting to mySQL

    Are you using ASP, PHP ASP.NET or what?
    "Brad Brevet" <bradbrevethotmail.com> wrote in message
    news:bfek7s$fgg$1forums.macromedia.com...
    > I am having trouble connecting to mySQL on my remote server. I was
    wondering
    > what I need to do to connect to mySQL server?
    >
    > Through several posts to this newsgroup I have decided to set my database
    up
    > on my server as opposed to locally and work with it that way, but I am
    > wondering if that means I will have to write all the code myself on
    > Dreamweaver and then test it through the remote or if I can connect to it
    > through the remote server and use the Application tools to set up my
    pages.
    >
    > Also I am using ipowerweb as my host so if anyone is using this and has
    been
    > successful please let me know.
    >
    > Please help?!?!?
    >
    > Thanks
    >
    > Brad
    >
    >

    Showjumper Guest

  4. #4

    Default Re: Connecting to mySQL

    PHP

    "Showjumper" <shojumpergrkjashdjkf.com> wrote in message
    news:bfekel$fq6$1forums.macromedia.com...
    > Are you using ASP, PHP ASP.NET or what?
    > "Brad Brevet" <bradbrevethotmail.com> wrote in message
    > news:bfek7s$fgg$1forums.macromedia.com...
    > > I am having trouble connecting to mySQL on my remote server. I was
    > wondering
    > > what I need to do to connect to mySQL server?
    > >
    > > Through several posts to this newsgroup I have decided to set my
    database
    > up
    > > on my server as opposed to locally and work with it that way, but I am
    > > wondering if that means I will have to write all the code myself on
    > > Dreamweaver and then test it through the remote or if I can connect to
    it
    > > through the remote server and use the Application tools to set up my
    > pages.
    > >
    > > Also I am using ipowerweb as my host so if anyone is using this and has
    > been
    > > successful please let me know.
    > >
    > > Please help?!?!?
    > >
    > > Thanks
    > >
    > > Brad
    > >
    > >
    >
    >

    Brad Brevet Guest

  5. #5

    Default Re: Connecting to mySQL

    Hi,
    I think its a normal way to develop your scripts on a local (developement)
    server. Its faster working, and the only thing what's different is the
    connection file. So, I ask me what is the problem? In the most cases you
    have to execute scripts on locahost using your production-server.

    Olaf

    "Brad Brevet" <bradbrevethotmail.com> schreef in bericht
    news:bfekr3$g8a$1forums.macromedia.com...
    > PHP
    >
    > "Showjumper" <shojumpergrkjashdjkf.com> wrote in message
    > news:bfekel$fq6$1forums.macromedia.com...
    > > Are you using ASP, PHP ASP.NET or what?
    > > "Brad Brevet" <bradbrevethotmail.com> wrote in message
    > > news:bfek7s$fgg$1forums.macromedia.com...
    > > > I am having trouble connecting to mySQL on my remote server. I was
    > > wondering
    > > > what I need to do to connect to mySQL server?
    > > >
    > > > Through several posts to this newsgroup I have decided to set my
    > database
    > > up
    > > > on my server as opposed to locally and work with it that way, but I am
    > > > wondering if that means I will have to write all the code myself on
    > > > Dreamweaver and then test it through the remote or if I can connect to
    > it
    > > > through the remote server and use the Application tools to set up my
    > > pages.
    > > >
    > > > Also I am using ipowerweb as my host so if anyone is using this and
    has
    > > been
    > > > successful please let me know.
    > > >
    > > > Please help?!?!?
    > > >
    > > > Thanks
    > > >
    > > > Brad
    > > >
    > > >
    > >
    > >
    >
    >

    Olaf Guest

  6. #6

    Default Re: connecting to mysql

    I haven't used mysql , but was reading about it on the mysql site and found
    that they have a provider for .net and that you call mysql just as you would
    SQL Server for the most part.
    so try using the Syntax specified for DSN with Sql server
    connections--except import your mysql provider namespace.

    I don't know much but I have learned this by reading about it...
    HTH
    Shane

    "Paul" <paulthemedialounge.com> wrote in message
    news:usiFs$qVDHA.2024TK2MSFTNGP12.phx.gbl...
    > I have a dsn called "dsnMYCONN" for a mySQL database but for the life of
    me
    > cant find any examples of creating a connection using a dsn. I am almost
    > certainly overlooking something.
    >
    > Can anyone give me a simple example of using a dsn and using it as the
    > source for anything ?
    >
    > Thanks Folks
    >
    >

    SStory Guest

  7. #7

    Default Re: connecting to mysql

    Paul,

    Try this with the ODBC .NET Data Provider:

    ConnectionString = "DSN=NameOfDSN;"

    If you need to create the connection string yourself, then try this
    (replacing the various values):

    ConnectionString =
    "DRIVER={MySQL};SERVER=10.0.0.1;UID=userid;PWD=pas sword;DATABASE=database;"

    --
    Carsten Thomsen
    Enterprise Development with Visual Studio .NET, UML, and MSF
    [url]http://www.apress.com/book/bookDisplay.html?bID=105[/url]
    "Paul" <paulthemedialounge.com> wrote in message
    news:usiFs$qVDHA.2024TK2MSFTNGP12.phx.gbl...
    > I have a dsn called "dsnMYCONN" for a mySQL database but for the life of
    me
    > cant find any examples of creating a connection using a dsn. I am almost
    > certainly overlooking something.
    >
    > Can anyone give me a simple example of using a dsn and using it as the
    > source for anything ?
    >
    > Thanks Folks
    >
    >

    CT Guest

  8. #8

    Default Re: connecting to mysql

    my sql is dsn less connection. follow the other suggestions posted to get
    your connection going. importantly you need the assemblies provided for .net
    from the company's website.

    "Paul" <paulthemedialounge.com> wrote in message
    news:usiFs$qVDHA.2024TK2MSFTNGP12.phx.gbl...
    > I have a dsn called "dsnMYCONN" for a mySQL database but for the life of
    me
    > cant find any examples of creating a connection using a dsn. I am almost
    > certainly overlooking something.
    >
    > Can anyone give me a simple example of using a dsn and using it as the
    > source for anything ?
    >
    > Thanks Folks
    >
    >

    Alvin Bruney Guest

  9. #9

    Default Connecting To MySQL

    I'm trying to set up MySQL 5.0 on Windows IIS Service Pack 2.0 with CF 7.01.
    Following tech notes from Macromedia it still doesn't work. I get the following
    error

    Connection verification failed for data source: mysqltest1
    java.sql.SQLException: No suitable driver available for mysqltest1, please
    check the driver setting in resources file, error: null
    The root cause was that: java.sql.SQLException: No suitable driver available
    for mysqltest1, please check the driver setting in resources file, error: null

    I extracted the to the CFMX 7.0 WEB INF library folder and this is error.

    Can someone please help




    jhutchdublin Guest

  10. #10

    Default Re: Connecting To MySQL

    How to set up MySQL 5.0 on Windows with Coldfusion MX7.x:

    - Download the current, stable version of the MySQL Connector/J JDBC driver
    (mysql-connector-java-3.{n}.zip), from the MySQL website.

    - Stop Coldfusion MX.

    - Extract the mysql-connector-java-3.{n}-bin.jar file from the downloaded
    archive file.

    - Save the mysql-connector-java-3.{n}-bin.jar file in the
    cf_root/WEB-INF/lib directory, after having deleted any previous, similar
    MySQL JAR files in the directory (cf_root is the path to Coldfusion's wwwroot
    folder).

    - Restart the ColdFusion MX server. Open the Coldfusion Administrator and go
    to the data sources section.

    - Choose a (user-defined) Data source name, for example, "MySQL_DSN".

    - Add a new data source to the ColdFusion MX Administrator,
    using the driver option "Other", not MySQL(3.x).

    - Enter the JDBC URL: jdbc:mysql://[host]:[port]/[database]
    For example, jdbc:mysql://127.0.0.1:3306/myDatabaseName, where myDatabaseName
    is the name of a database situated in the "data" directory of the MySQL
    installation.

    - Enter the Driver Class: com.mysql.jdbc.Driver

    - Choose a (user-defined) driver name, for example, "MySQL50"

    - Enter username/password.

    - Submit the data source for verification





    BKBK Guest

  11. #11

    Default Re: Connecting To MySQL

    Thank you this worked
    jhutchdublin Guest

  12. #12

    Default Re: Connecting To MySQL

    Hi,

    Don't know what I'm doing wrong, I'm trying to connect Mysql 5 and coldfusion
    7, I've followed this procedure without success, all I got was an error message
    saying that Coldfusion could not find any driver.
    I've tried to put the file elsewhere, and the best I got was "timeout while
    trying to connect".

    Somebody else had the same issue? and how did you get around it?

    Thanks



    Kryss2099 Guest

  13. #13

    Default Re: Connecting To MySQL

    Stop Coldfusion.

    Download and install the
    [url]http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-3.1.12.zip/f[/url]
    rom/pick#mirrors . Extract (unzip) the JAR file,
    mysql-connector-java-3.1.12-bin.JAR. Save it in the cf_root/WEB-INF/lib
    directory, after having deleted any previous, similar MySQL JAR files in the
    directory (cf_root is the path to Coldfusion's wwwroot folder).

    Restart Coldfusion and configure the Coldfusion Administrator as above.



    BKBK Guest

Similar Threads

  1. Connecting MySQL to Coldfusion on XP Pro
    By bioneuralnet in forum Coldfusion - Getting Started
    Replies: 3
    Last Post: November 28th, 08:04 PM
  2. Connecting to MySQL 5.0, How?
    By feiloiram in forum Coldfusion Database Access
    Replies: 7
    Last Post: August 19th, 09:03 PM
  3. Connecting with MySQL
    By Ashley_02 in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: July 15th, 02:47 AM
  4. Connecting to MySQL 4.1
    By Stressed_Simon in forum Coldfusion Database Access
    Replies: 1
    Last Post: July 1st, 12:24 PM
  5. connecting mysql
    By dummmmmbo in forum Dreamweaver AppDev
    Replies: 1
    Last Post: March 1st, 12:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139