Benches macOS

17

using terminal to connect to localhost:88…

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

I have mysql installed and im using terminal to connect to localhost:8888 but its not working

mysql -h localhost:8888 -u root

What am I doing wrong?

thanks in advance

17 replies

Sign in or join Beachball Help to reply.

  1. 0

    art22

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    You don't have to ssh into MAMP. You connect to your computer via ssh as any user who can execute the mysql command, e.g. ssh [email protected].1.1, and then run the mysql commandline from my last post. The mysql users are not the same users, you would use to log into your computer, they are completely separate. So you can login as nerd2 and then access mysql as root without problems. You could then remotely access the MAMP hosted pages as
    http://192.168.1.1:8888/someFolder.

    But glad to hear, you're already up and running.

    @BDAqua: Thank you for the kind welcome.

  2. 0

    art22

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I think you cannot ssh to your machine as root if you didn't enable the root user on your computer (it isn't enabled by default and you shouldn't, unless you have a very good reason to do so).

    If you just need a webserver for local testing of webpages you can use MAMP. If you do, simply enter

    /Applications/MAMP/Library/bin/mysql -u root -p

    It then asks you for your password (root) and you're done (the mysql root user has nothing to do with your systems root user). You can also use phpMyAdmin from the MAMP startpage.

    That's the way I do it here and it works flawlessly. The latest MAMP comes with PHP 5.2.6 and MySQL 5.0.41. Place your pages inside /Applications/MAMP/htdocs/someFolder and then you can access them via
    http://localhost:8888/someFolder. Use localhost:8889 as your MySQL host in your scripts with user root/password root.

    Most paths in MAMP are hardcoded, so you have to install it in /Applications (or place an alias of the MAMP folder there).

    Hope it helps.

    Ralf.

  3. 0

    nerd2

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    update:

    I am able to ssh into my machine from my machine as [email protected].1.1 it accepts password and im in!

    however, if I attempt to connect to mysql server on same machine:

    ssh root@localhost

    it will continue to ask for the password over and over,

    I even setup no-password for root user in phpmyadmin, still nothing...

    how can I resolve this?

    nerd2

  4. 0

    nerd2

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    anyone?

  5. 0

    BDAqua

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi there,

    I've been watching this thread hoping one of the experts would drop in, but since they haven't...

    What version of php/mysql do you have installed?

    It sort of sounds like a config file isn't setup right to direct it to the proper location.

  6. 0

    nerd2

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I had mysql 5.0 and PHP 5.2.4 for Apache 1.3 from entropy.ch, followed al the instructions everything installed correctly I could access the test page by
    http://localhost... but I could not ssh into localhost.

    I even had MAMP mamp.info installed same issue and tried WMAPP same ssh issue.

    So im sure it has something to do with my ssh settings?

    I can ssh into my machine just fine just not localhost/web server

  7. 0

    BDAqua

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Might see if there's any clues here...

    http://realprogrammers.com/hack/SSH/tunneling.html

  8. 0

    nerd2

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Tried what they said I still get the same error.

  9. 0

    nerd2

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    william-computer:~ nerd$ ssh root@localhost

    Password:

    Password:

    Password:

    root@localhost's password:

    Permission denied, please try again.

    root@localhost's password:

    Permission denied, please try again.

    root@localhost's password:

    Received disconnect from ::1: 2: Too many authentication failures for root

    william-computer:~ nerd$ ssh root@localhost -p 8889

    ssh
    exchangeidentification: Connection closed by remote host

    william-computer:~ nerd$

  10. 0

    nerd2

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    even tried connecting via 127.0.0.1, used 80, 3306, 8889 as possible ports

    william-computer:~ nerd$ ssh [email protected] -p 8889

    ssh
    exchangeidentification: Connection closed by remote host

    william-computer:~ nerd$

    nerd2

  11. 0

    nerd2

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    something I was curious to try, how can I change the directory that localhost points to be default to that of another directory.

    like from /usr/local/ to w/e...

  12. 0

    BDAqua

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    System-wide configuration— (path: /etc/httpd/httpd.conf) This is the master configuration file. It contains information about the system as a whole—what directories are accessible, what plug-ins are in use, and so on. Changes to the Web server as a whole are included here.

    User-directory configuration— (path: /etc/httpd/users/ username.conf ) When the Mac OS X Users System Preference panel creates a new account, it automatically adds a basic configuration file for that user within the /etc/httpd/users directory. This mini configuration file determines the security for the Web pages within a user's Sites folder.

    http://www.informit.com/library/content.aspx?b=MacOS_XUnleashed&seqNum=211

    Of course that may not apply to where you have the new one installed.

  13. 0

    art22

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I think you cannot ssh to your machine as root if you didn't enable the root user on your computer (it isn't enabled by default and you shouldn't, unless you have a very good reason to do so).

    If you just need a webserver for local testing of webpages you can use MAMP. If you do, simply enter

    /Applications/MAMP/Library/bin/mysql -u root -p

    It then asks you for your password (root) and you're done (the mysql root user has nothing to do with your systems root user). You can also use phpMyAdmin from the MAMP startpage.

    That's the way I do it here and it works flawlessly. The latest MAMP comes with PHP 5.2.6 and MySQL 5.0.41. Place your pages inside /Applications/MAMP/htdocs/someFolder and then you can access them via
    http://localhost:8888/someFolder. Use localhost:8889 as your MySQL host in your scripts with user root/password root.

    Most paths in MAMP are hardcoded, so you have to install it in /Applications (or place an alias of the MAMP folder there).

    Hope it helps.

    Ralf.

  14. 0

    nerd2

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    kudos to the both of you! I just trashed MAMP and WMAPP and installed mysql and php, and I am now able to access via ssh commands.

    I like MAMP, I just need to be able to ssh into it, if I can't ssh into it from my machine, I will not be able to ssh into from another machine...

    edited by nerd2

  15. 0

    BDAqua

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi Ralf, und ein herzliches Willkommen zu den Foren! 🙂

    Great first post/tip, thanks, and hope to see more of you here! 🙂

  16. 0

    art22

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    You don't have to ssh into MAMP. You connect to your computer via ssh as any user who can execute the mysql command, e.g. ssh [email protected].1.1, and then run the mysql commandline from my last post. The mysql users are not the same users, you would use to log into your computer, they are completely separate. So you can login as nerd2 and then access mysql as root without problems. You could then remotely access the MAMP hosted pages as
    http://192.168.1.1:8888/someFolder.

    But glad to hear, you're already up and running.

    @BDAqua: Thank you for the kind welcome.

  17. 0

    nerd2

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    wow, thanks art! Got it working now. Kudos to you!