A Flash Developer Resource Site

Results 1 to 17 of 17

Thread: mySQL

  1. #1
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971

    mySQL

    Hi there! I downloaded a PHP chat system, and it requires mySQL. I'm hosting a website on my computer as a server with IIS. My site is running already, now I want to know how to install and configure mySQL so it's inside my host. I'm using the port 4412 for the website. When the SQL is ready, I only have to put the php chat files on the root, and when I open the index.php, it will create mySQL TABLES automatically. Hope someone can help ^_^

  2. #2
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Anyone?

  3. #3
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    http://dev.mysql.com/downloads/

    Just download the free version and fill in the settings in the installation. Shouldn't be that hard to do. You may need to create a user according to your chat software (weird to use a database for chat software, but eh).

  4. #4
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Is a PHP chat. I don't know if it will works hehe, but it worth the try. I tried to install it in a free hosting that i have, but they don't allow SCRIPTS, so I decide making this IIS website in my computer as a server. I installed mySQL already, but i don't know how to match it up with my site, so a install the database and link the .php files to it. My site is in the port 4412, and mySQl in 3306...Thanks for replying, hope u can help me further.

  5. #5
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    So what part are you having problems with? Do your scripts not link up to the database properly, isn't port 80 forwarded to port 4412? Btw, I'm more of a J2EE guy than php, so I know very little about that.

  6. #6
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    I'm more of HTML, graphic design, music and actionscripting, im new in mySQL and PHP. The site is working at port 4412, no problem with that, but i don't know how to set the mySQL database properly so I can link it to my website root folder, and upload the .php files inside. I suppose I have to do the same that with my site, make a rule in the firewall and in the modem to open the port 3306, but how I put the database in my site? Or does it has to stay in the mySQL installation folder in order to work?

  7. #7
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    I created it with this details: host: localhost user: root port: 3306 password:*****

    But then it opens a windows: Database Schema and table selection

    And some schemas to select: information_schema, mysql, permormance_schema, sakila, test and world...

    And :Select Table



    What to do there?

  8. #8
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    Quote Originally Posted by angelhdz View Post
    but i don't know how to set the mySQL database properly so I can link it to my website root folder, and upload the .php files inside
    Well that just doesn't make sense. Quick course on server software.

    A server is a computer which you make requests to, which it executes and may send a response back (but not necessarily). A server, doesn't know a thing about a request or a response, the installed software does. The server just provides infrastructure and hands over requests

    For example on your home desktop computer, a piece of software can reside anywhere, as long as your computer knows when to call upon it to do something with a file. Say you open a pdf file, if your computer has Acrobat installed, it'll know to open that program and hand the 'request' over to that software. If you don't have Acrobat installed, it wouldn't know what to do with it and notify you to select a piece of software that it can use.

    So it doesn't really matter where you install php, mysql etc. As long as they're properly configured to run as a service/daemon at a certain port, than it knows that if a request comes in at a certain port, that the request should be handled by that piece of software. Or routed to some other port, but that's a whole other subject.

    I advise you to look for some software to administer mySql databases. This way you can login as root to your database and see what's going on. That would be a good check to see if mySQL is installed properly and running. I personally have good experiences with SQLyog, but I don't think there's a free version. The workbench that comes with mySQL may have some admin tool if I recal correctly, but it's been a while.

    Next step, is to let your php script find your database. First it must have acces to it, so it must have credentials to a user in your database (for security, don't make it root, to limit damage if it may get hacked). It must make requests to the right address, so check if it's using localhost and port 3306 to make requests to.

    Btw, you may want to look into WAMP (I guess you're a windows user) or else LAMP (Linux) or MAMP (Mac), as this installs an Apache server, with MySQL and PHP. It uses PHPadmin for database management, which I seriously advise you NOT to use, as it is very easy to lock you out of your own database. I'm not proud to say this happened to me on more than one occasion.

  9. #9
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    You replied while I was typing.

    Quote Originally Posted by angelhdz View Post
    I created it with this details: host: localhost user: root port: 3306 password:*****

    But then it opens a windows: Database Schema and table selection?
    What exactly opens a window? The chat software?

  10. #10
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    I reed something about myPHPAdmin....i'm thinking in installing it to see if it helps me to configure mySQL correctly. Ok i create the database, and my php files are suppose to install the tables automaticlly, but if I open the index.php in my browsers, instead of showing the chat, as it did in my other hosting, it shows ALL the code instead...i understand what you said, but we are talking about TWO ports: my website port 4412, and mySQP port 3306. Everything that is in my website root folder is called by port 4412, and if the mySQL database is at port 3306, how we call it?

  11. #11
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    No no no, im talking when I'm configuring mySQL, it opens/shows a windows to specify that details, but now i realize it has nothing to do with it, because that windows is for creating TABLES, and i dont need to creates tables now, because my PHP chat configuration.php will create them automatically

  12. #12
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    Quote Originally Posted by angelhdz View Post
    but if I open the index.php in my browsers, instead of showing the chat, as it did in my other hosting, it shows ALL the code instead...i understand what you said, but we are talking about TWO ports: my website port 4412, and mySQP port 3306. Everything that is in my website root folder is called by port 4412, and if the mySQL database is at port 3306, how we call it?
    Ah, so php isn't used to make sense of the script so the browser just shows the contents of the file. A browser uses port 80 as default so you'll have to manually use port 4412 or configure your server to forward calls to port 80 to port 4412. Before you start down the road of firewall configuration you may want to just manually call on port 4412. I don't know how knowledgeable you are on this subject but just in case:

    urlortnumber

    for example
    http://localhost/index.php:4412

    if you do not get an error or a succes, than there's a good chance that php isn't running at all.

  13. #13
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    I forgot about this chat , and found another one even better. It says it doesn't need a mySQL database, is file based.




    http://www.phpfreechat.net/quickstart

  14. #14
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697
    To answer your question on how two ports are handled. There should be a call in your php scripts to localhost:3306. This is the basic control - model tier setup.

    The controller (php) makes calls to the model(database), processes the result and feeds it back to the view (browser/php, php doesn't really seperate view and control).

    So if you call your php files, than they should handle all the port 3306 stuff for you and your browser would be none the wiser.

  15. #15
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Yeah i figured it out, in my configuration.php file , where it says host i put localhost:3306, also i test http://localhost:3306 and it showed stuff about mySQL, telling me everything's fine. But now i think i will use this other chat that doesn't need mySQL, and if i need mySQL later, now I know where to start. Thanks!

  16. #16
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    This is the php chat i'm trying to install http://www.phpfreechat.net/required-config

  17. #17
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    I'don't know now how to install PHP in IIS..any help?

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center