SQL from webpage:

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel

    SQL from webpage:

    Hi,

    Let's say that I can't log on to the MySQL daemon on the server; Is it
    then possible to use the dump-file from mysqldump in a PHP-query so it
    can be executed/processed on the localhost? I've tried just pasting the
    SQL into a simple query, but it doesn't seem to work. And I can't find
    much info about it anywhere. It all requires me to log on or create a
    connection from outside localhost ... and I can't.

    Thanks,

    --
    Daniel Henriksen
    dsh@vip.cyberci ty.dk

    Soccer Games Homepage:


  • Aggro

    #2
    Re: SQL from webpage:

    Daniel wrote:
    [color=blue]
    > Hi,
    >
    > Let's say that I can't log on to the MySQL daemon on the server; Is it
    > then possible to use the dump-file from mysqldump in a PHP-query so it
    > can be executed/processed on the localhost? I've tried just pasting the
    > SQL into a simple query, but it doesn't seem to work. And I can't find
    > much info about it anywhere. It all requires me to log on or create a
    > connection from outside localhost ... and I can't.[/color]

    You can log into mysql from outside the localhost, if you want to. Would
    this be a better solution or is there some reason for not doing this?

    Comment

    • Aggro

      #3
      Re: SQL from webpage:

      Daniel wrote:
      [color=blue]
      > Hi,
      >
      > Let's say that I can't log on to the MySQL daemon on the server; Is it
      > then possible to use the dump-file from mysqldump in a PHP-query so it
      > can be executed/processed on the localhost? I've tried just pasting the
      > SQL into a simple query, but it doesn't seem to work. And I can't find
      > much info about it anywhere. It all requires me to log on or create a
      > connection from outside localhost ... and I can't.[/color]

      You can log into mysql from outside the localhost, if you want to. Would
      this be a better solution or is there some reason for not doing this?

      Comment

      • Aggro

        #4
        Re: SQL from webpage:

        Daniel wrote:
        [color=blue]
        > Hi,
        >
        > Let's say that I can't log on to the MySQL daemon on the server; Is it
        > then possible to use the dump-file from mysqldump in a PHP-query so it
        > can be executed/processed on the localhost? I've tried just pasting the
        > SQL into a simple query, but it doesn't seem to work. And I can't find
        > much info about it anywhere. It all requires me to log on or create a
        > connection from outside localhost ... and I can't.[/color]

        You can log into mysql from outside the localhost, if you want to. Would
        this be a better solution or is there some reason for not doing this?

        Comment

        • Daniel

          #5
          Re: SQL from webpage:

          Aggro wrote:[color=blue]
          > You can log into mysql from outside the localhost, if you want to. Would
          > this be a better solution or is there some reason for not doing this?[/color]

          I know I can and wish I could, but there is obviously a problem allowing
          my hostname, so I cannot log on mySQL and access the database. Alas this
          may seem to take a while to fix and (having spent some time programming
          a new site in PHP) I would very much like to have my site up and running
          =) That's why I ask. Hmm, but it doubt I can ... =(

          Thanks for your time,

          --
          Daniel Henriksen
          dsh@vip.cyberci ty.dk

          Soccer Games Homepage:


          Comment

          • Daniel

            #6
            Re: SQL from webpage:

            Aggro wrote:[color=blue]
            > You can log into mysql from outside the localhost, if you want to. Would
            > this be a better solution or is there some reason for not doing this?[/color]

            I know I can and wish I could, but there is obviously a problem allowing
            my hostname, so I cannot log on mySQL and access the database. Alas this
            may seem to take a while to fix and (having spent some time programming
            a new site in PHP) I would very much like to have my site up and running
            =) That's why I ask. Hmm, but it doubt I can ... =(

            Thanks for your time,

            --
            Daniel Henriksen
            dsh@vip.cyberci ty.dk

            Soccer Games Homepage:


            Comment

            • Daniel

              #7
              Re: SQL from webpage:

              Aggro wrote:[color=blue]
              > You can log into mysql from outside the localhost, if you want to. Would
              > this be a better solution or is there some reason for not doing this?[/color]

              I know I can and wish I could, but there is obviously a problem allowing
              my hostname, so I cannot log on mySQL and access the database. Alas this
              may seem to take a while to fix and (having spent some time programming
              a new site in PHP) I would very much like to have my site up and running
              =) That's why I ask. Hmm, but it doubt I can ... =(

              Thanks for your time,

              --
              Daniel Henriksen
              dsh@vip.cyberci ty.dk

              Soccer Games Homepage:


              Comment

              • Aggro

                #8
                Re: SQL from webpage:

                Daniel wrote:
                [color=blue]
                > I know I can and wish I could, but there is obviously a problem allowing
                > my hostname, so I cannot log on mySQL and access the database. Alas this
                > may seem to take a while to fix and (having spent some time programming
                > a new site in PHP) I would very much like to have my site up and running
                > =) That's why I ask. Hmm, but it doubt I can ... =([/color]

                I'm not sure what you are talking about..

                Are you able to log in to mysql as root? (From localhost that is)
                Do you know about the "grant" syntax? For example...

                -----------
                This will allow "user" to connect to "database" only from localhost:

                GRANT ALL ON database.* TO user@localhost IDENTIFIED BY "password"

                -----------
                This will do the same, except this allows connection only from example.com:

                GRANT ALL ON database.* TO user@example.co m IDENTIFIED BY "password"

                -----------
                And this allows connection from any address starting with 192.168.0.

                GRANT ALL ON database.* TO user@'192.168.0 .%' IDENTIFIED BY "password"

                -----------
                I hope this helps, but I'm still unsure about what the problem is, sorry.

                Comment

                • Aggro

                  #9
                  Re: SQL from webpage:

                  Daniel wrote:
                  [color=blue]
                  > I know I can and wish I could, but there is obviously a problem allowing
                  > my hostname, so I cannot log on mySQL and access the database. Alas this
                  > may seem to take a while to fix and (having spent some time programming
                  > a new site in PHP) I would very much like to have my site up and running
                  > =) That's why I ask. Hmm, but it doubt I can ... =([/color]

                  I'm not sure what you are talking about..

                  Are you able to log in to mysql as root? (From localhost that is)
                  Do you know about the "grant" syntax? For example...

                  -----------
                  This will allow "user" to connect to "database" only from localhost:

                  GRANT ALL ON database.* TO user@localhost IDENTIFIED BY "password"

                  -----------
                  This will do the same, except this allows connection only from example.com:

                  GRANT ALL ON database.* TO user@example.co m IDENTIFIED BY "password"

                  -----------
                  And this allows connection from any address starting with 192.168.0.

                  GRANT ALL ON database.* TO user@'192.168.0 .%' IDENTIFIED BY "password"

                  -----------
                  I hope this helps, but I'm still unsure about what the problem is, sorry.

                  Comment

                  • Aggro

                    #10
                    Re: SQL from webpage:

                    Daniel wrote:
                    [color=blue]
                    > I know I can and wish I could, but there is obviously a problem allowing
                    > my hostname, so I cannot log on mySQL and access the database. Alas this
                    > may seem to take a while to fix and (having spent some time programming
                    > a new site in PHP) I would very much like to have my site up and running
                    > =) That's why I ask. Hmm, but it doubt I can ... =([/color]

                    I'm not sure what you are talking about..

                    Are you able to log in to mysql as root? (From localhost that is)
                    Do you know about the "grant" syntax? For example...

                    -----------
                    This will allow "user" to connect to "database" only from localhost:

                    GRANT ALL ON database.* TO user@localhost IDENTIFIED BY "password"

                    -----------
                    This will do the same, except this allows connection only from example.com:

                    GRANT ALL ON database.* TO user@example.co m IDENTIFIED BY "password"

                    -----------
                    And this allows connection from any address starting with 192.168.0.

                    GRANT ALL ON database.* TO user@'192.168.0 .%' IDENTIFIED BY "password"

                    -----------
                    I hope this helps, but I'm still unsure about what the problem is, sorry.

                    Comment

                    • Aggro

                      #11
                      Re: SQL from webpage:

                      Daniel wrote:
                      [color=blue]
                      > I'm not able to log in at all. Please bear in mind that I'm not the
                      > server-admin and the only thing I can run on localhost is the PHP-pages
                      > and that's why I was asking if I can use the sql from mysqldump in a
                      > query on one of these PHP-pages ... I'm not able to log in on mySQL (if
                      > I could I could as well use mysqldump to recreate the tables) and I
                      > cannot use any mySQL commands.[/color]

                      Ok now I understand. But I'm not yet sure how or what you are doing with
                      php. I'm pretty sure you can create tables etc. if you have rights to do
                      so. I don't know if php have it's own system to do this, so you need to
                      check

                      PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


                      website, or ask from some php related newsgroups. I bulieve the website
                      has a very good documentation about these things.


                      Comment

                      • Aggro

                        #12
                        Re: SQL from webpage:

                        Daniel wrote:
                        [color=blue]
                        > I'm not able to log in at all. Please bear in mind that I'm not the
                        > server-admin and the only thing I can run on localhost is the PHP-pages
                        > and that's why I was asking if I can use the sql from mysqldump in a
                        > query on one of these PHP-pages ... I'm not able to log in on mySQL (if
                        > I could I could as well use mysqldump to recreate the tables) and I
                        > cannot use any mySQL commands.[/color]

                        Ok now I understand. But I'm not yet sure how or what you are doing with
                        php. I'm pretty sure you can create tables etc. if you have rights to do
                        so. I don't know if php have it's own system to do this, so you need to
                        check

                        PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


                        website, or ask from some php related newsgroups. I bulieve the website
                        has a very good documentation about these things.


                        Comment

                        • Aggro

                          #13
                          Re: SQL from webpage:

                          Daniel wrote:
                          [color=blue]
                          > I'm not able to log in at all. Please bear in mind that I'm not the
                          > server-admin and the only thing I can run on localhost is the PHP-pages
                          > and that's why I was asking if I can use the sql from mysqldump in a
                          > query on one of these PHP-pages ... I'm not able to log in on mySQL (if
                          > I could I could as well use mysqldump to recreate the tables) and I
                          > cannot use any mySQL commands.[/color]

                          Ok now I understand. But I'm not yet sure how or what you are doing with
                          php. I'm pretty sure you can create tables etc. if you have rights to do
                          so. I don't know if php have it's own system to do this, so you need to
                          check

                          PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


                          website, or ask from some php related newsgroups. I bulieve the website
                          has a very good documentation about these things.


                          Comment

                          Working...