MySQL

Collapse
X
Collapse
+ More Options
Posts
 
  • Time
  • Show
Clear All
new posts
  • shovenose
    Send Doge Memes
    • Aug 2010
    • 6575
    • USA

    #1

    MySQL

    I have 3 servers in my house:
    1. Minecraft server, Windows 2003 Server, port 25565
    2. Web and database server for a forum http://shovenose.dyndns.org/ ,Ubuntu Server 11.10, port 80
    3. THE ONE I NEED HELP WITH, internal LAN IP 10.0.1.52

    It's also running Ubuntu Server 11.10, both linux servers (2&3) use EHCP hosting control panel...
    If I type in http://10.0.1.52/phpmyadmin/ then it takes me to PHPMYADMIN properly...
    But if I'm anywhere else and type in http://shovenose.dyndns.org/phpmyadmin it takes me to the login for #2 (local IP 10.0.1.48) because port 80 forwards to that.

    So I'm wondering, can I make it so that people can type in http://shovenose.dyndns.org/phpmyadmin and they end up at the login for SERVER #3 not SERVER #2?
    It looks like phpMyAdmin uses port 80 for its interface, while the actual MySQL uses port TCP3306 (I think?)
    I'm sure I can get a database connection to 3006 to route to server 3 but how would I get the web interface for phpmyadmin to go to server 3 while all other web stuff (also port 80) goes to server #2 because I have a website/forum that needs to show up there.

    Help please! Thanks!
  • mariushm
    Badcaps Legend
    • May 2011
    • 3799

    #2
    Re: MySQL

    Mysql has it's own port, 3306. You can configure it to use pipes or sockets and not use a port at all but that's outside the point of this post.
    Besides the port, by default when you configure mysql with the wizard or whatever, it recommends that you configure mysql to listen only on its own "localhost", for security reasons.

    First thing you must absolutely do is rename that script folder to something else. I have several websites and can give you megabytes of logs where bots keep trying to find phpMyAdmin installations and exploit them.
    I'm using custom subdomains for my own installs, something like pma-sv1.example.org and sometimes I even reject all IPs except my home one with .htaccess rules

    You can configure phpMyAdmin to connect to whatever mysql instance you want, you have in the phpMyAdmin folder a file called config.inc.php
    There, you have a section that should look like this (this may be different, I'm not using the very latest versions, prefer to use STABLE releases):

    PHP Code:
    /*
     * Servers configuration
     */
    $i 0;

    /*
     * First server
     */
    $i++;
    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    /* Server parameters */
    $cfg['Servers'][$i]['host'] = 'localhost';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    /* Select mysqli if your server has it */
    $cfg['Servers'][$i]['extension'] = 'mysql';
    $cfg['Servers'][$i]['AllowNoPassword'] = false
    For this computer, localhost means 127.0.0.1, so phpMyAdmin tries to connect to mySQL on 127.0.0.1, and there's no such server listening for connections there.
    So you need to replace localhost with 10.0.1.52

    Now depending on how you configured MySQL, phpMyAdmin will connect to MySQL or not.

    As I said at the start of the post, by default MySQL tends to configure itself to listen on "localhost" only, but from the computer's perspective localhost is 127.0.0.1 and 10.0.1.52 is another network card.

    So if MySQL is configured for localhost only or to use sockets/pipes, you have to tell it to listen on the 10.0.1.52 IP for connections. You need to go in my.ini and below [mysqld] you should find

    port=3306

    Add above it :

    bind-address=10.0.1.52

    to configure mysql to listen for connections on 10.0.1.52

    If you want it to listen to both localhost and the IP and all IPs you may have, try saying bind-address=0.0.0.0

    ... and restart mysql to start listening on the IP.

    let me know if you don't understand something, i'll be around for a bit more (it's 8 am here and haven't slept so far because of work).
    Last edited by mariushm; 01-13-2012, 11:58 PM.

    Comment

    • shovenose
      Send Doge Memes
      • Aug 2010
      • 6575
      • USA

      #3
      Re: MySQL

      OK, I don't know how to edit that file/\.
      Thanks.
      shovenose

      Comment

      • mariushm
        Badcaps Legend
        • May 2011
        • 3799

        #4
        Re: MySQL

        What do you mean, you don't know WHAT to edit, or you don't know how to EDIT a file in general?

        I just said, you have to replace "localhost" with the IPs and if needed set mysql IP in my.ini - I don't know where it's located in various Linuxes...

        Comment

        • shovenose
          Send Doge Memes
          • Aug 2010
          • 6575
          • USA

          #5
          Re: MySQL

          I'm running Ubuntu Server, which is command-line only.
          How/where do I edit it?

          Comment

          • mariushm
            Badcaps Legend
            • May 2011
            • 3799

            #6
            Re: MySQL

            http://www.howtoforge.com/faq/12_15_en.html

            There should be several text editors included - vi is one of them which is bit harder to operate, it's not "notepad", it's kind of like "the wordpad" of editors.

            Remember, it's :
            "i" to enter insert mode and type text at the cursor position, ESC to exit the insert mode
            "x" to delete the character under the cursor
            :x to save the file
            :q to quit the editor (don't forget to use :x before)

            Read the link above carefully and then you should have the my.ini on Ubuntu saved as : /etc/mysql/my.cnf

            At least that's the location this page says: https://help.ubuntu.com/11.04/serverguide/C/mysql.html

            After editing the file, sudo /etc/init.d/mysql restart in command line - sudo may not be required if you run as root.

            Comment

            • shovenose
              Send Doge Memes
              • Aug 2010
              • 6575
              • USA

              #7
              Re: MySQL

              Thanks I'll try that when I get home... currently my SSH access port forwards to the other server not the one I want to be the MySQL server

              Comment

              Related Topics

              Collapse

              • omega
                Troubleshooting of redundant F750E-S0 Dell PowerEdge Server
                by omega
                Hello all,
                as a beginner electronics hobbyist, after a few years I would like to place another post on this Forum section, given that I did not succeed in finding any useful advice among the other posts.

                Over the last years, I have been using a PowerEdge Dell Server with two redundant PSUs, namely the 750W F750E-S0 ones (aka 06W2PW). Unfortunately, last summer one of them failed (perhaps owing to an overheating), and the server had for working to take into account the other one only. Of course I opened and tried to troubleshoot the failed PSU, but each cap I tested seemed to...
                02-09-2024, 03:34 PM
              • Document Archive
                HP ZBook 15v G5 Mobile server 15v Specification for Upgrade or Repair
                by Document Archive
                This specification for the HP ZBook 15v G5 Mobile server can be useful for upgrading or repairing a laptop that is not working. As a community we are working through our specifications to add valuable data like the 15v G5 boardview and 15v G5 schematic. Our users have donated over 1 million documents which are being added to the site. This page will be updated soon with additional information. Alternatively you can request additional help from our users directly on the relevant badcaps forum. Please note that we offer no warranties that any specification, datasheet, or download for HP ZBook 15v...
                09-06-2024, 11:39 AM
              • harp
                Comparing FreeNAS, FTP server, SMB server, multimedia server...
                by harp
                I thinking about some central LAN file server, on where I can put some files from other devices, or access to them, and maybe play some movie without download...

                I never study this, but when I see that freenas need few gigabyte of ram to recommended working, some wiered partition, I wonder if I miss somewhat in the midletime...
                Also exist "turnkey file server", and other turnkey products that I can not distinguished what is major difference and how it perform - no experiance at all.

                What is general difference between this products, and what be most useful...
                01-04-2024, 02:44 PM
              • ratdude747
                Server Upgrade?
                by ratdude747
                I'm pushing 5 years on my current server and I'm thinking it may be time for some sort of an upgrade.

                The main issue I'm having is random ATA errors locking the system up at the most inopportune times. Probably the PATA to SATA adapter (I have a few more NOS ones on the shelf I could toss at it) but honestly I'm thinking an old "early" socket 940 board is a retro rig in 2023 and ough to be retired.

                The question for me is how much of an upgrade should I shoot for? The main issue I have to deal with is if I keep my chassis, the backplane is 16x SATA. Not SAS....
                01-31-2023, 05:49 PM
              • Fireballcz
                Windows 2016 server L2TP/IPsec VPN - two subnets
                by Fireballcz
                Hello, please how to properly configure VPN in this environment?
                I have two subnets in two different (geographical) workplaces, connected via IPsec (thru gateway routers)
                Main subnet: 192.168.11.0/24, gateway (router IP) 192.168.11.1, Windows 2016 server (VPN, DHCP, DC etc.) 192.168.11.3
                2nd subnet : 192.168.22.0/24, gateway (router IP) 192.168.22.1 - just client computers.

                I need to allow external (home office) users connect via VPN server (192.168.11.3) to the 2nd subnet (192.168.22.0/24) to their computers (via RDP).
                I have no problems with VPN connection...
                07-29-2022, 03:20 AM
              • Loading...
              • No more items.
              Working...