mysqlworkbecnh connection to mysql - mysql-workbench

I could not connect to mysql with my mysqlworkbench.
I am using mamp and it gives me the below error:
Failed to Connect to MySQL at localhost:8888 with user root
I have put the username "root" and no password.
Hostname:localhost Port:8888

Normally we get this issue when the port is used from another app in the background.
So check your running programs or change mamp port itself to anything else like
port:7001.
I recommend Xampp if you're using Windows Operating system. It works well on port:3306.

Related

pgAdmin 4. Unable to connect to server

I had a postgreSQL server/database working in a local area network in Windows. To have access to it through Ethernet I changed the IP in the router settings. Everything was fine. But when I came today to the office, I could not have connected to the server. Moreover, I cannot even create a localhost server on that PC. The error is "Unable to connect to server:" and nothing else. When I turn off the postgres in services it specifies the error with TCP/IP, port, etc. But not when the service is on. When connecting to the server, the pgAdmin asks for the postgres password. Endlessly, thou the password is printed correctly and the METHOD is set to trust. The reinstallation did not help.
What does this error mean? And what is the cure?

postgreSQL server not loading

I'm trying to install postgreSQL(11) server on my local machine.I have downloaded PgAdmin 4(Mac) from the official website and installed it.
When I open the pgadmin the server is opening on random ports like 55957,55062 etc, not on 5432.
I have edited my "PostgreSQL.conf" and changed the listen address=* and port =5432 ,but I could not able to restart the service.
When I type "sudo service postgreSQL restart" it was showing "Sudo : Service command not found"
Also "Sudo command not found".
I don't have much experience in installing postgreSQL ,Can anyone please let me know what I'm doing wrong and let me know how I can add the server in postgres.
Note: I have opened pgadmin - select add new server - localhost as server name and User and DB as postgres.But when I put 5432 as port it was giving the common error "Whether TCP/ip accepting on 5432" and when I put the port where the pgadmin server is currently running (127.0.0.1:55097) it was getting timed out exception.

Accessing WSL postgresql server from Windows PGadmin

I am running postgresql in WSL Ubuntu on windows. Everything is up to speed, my data is loaded and I wish to access the database through some graphical interface. I was thinking pgadmin4.
Is it possible to accomplish this through a windows install of pgadmin4? I installed pgadmin4 on windows and tried to connect the traditional way in the GUI through localhost but am not getting a connection. I figure there may be a special method here.
For everyone else stumbling across this: The best way to do this (that I know of) is to SSH into your local WSL and then configure the SSH in pgAdmin to that.
I have yet to figure out, how to use this remotely.
As long as postgres is running within your wsl2 instance (check with sudo service postgresql status) then within PgAdmin 4 (running in windows), all you need to do is click to "Register" a new server.
Then, while entering the Connection data, set host to localhost and port to 5432 (unless you specified unique port within your postgres instance when creating in wsl2.
See this answer for more detail
There is no special way needed, you should be able to get a connection. Just like your dev http ports are exposed to your browser on Windows, your db port should too.
I had to manually add localhost to pg admin though which is a bit weird.
Make sure your db service is up and running on Ubuntu, sometimes the db service is killed for no reason.
To see if your PostgresSQL service is up or not:
sudo service postgresql status
If it's not, start the service:
sudo service postgresql start

MongoDB Server Ubuntu 16.04

I've installed MongoDB on my Ubuntu 16.04 VPS and allowed connections through the firewall. When I run the server using the command (mongod), it starts without a problem and I can then connect to it (using RoboMongo as test application).
However, when I run the service automatically on startup (using systemctl), I cannot connect to it. I verified it was running, and could not run it myself as the address was already in use.
Does anyone have any experience with this, or any tips on how to solve the problem? The server will be running localhost only and I'm going to be using an SSH tunnel for testing purposes, so no authentication is necessary.
Anyone?
When you started mongod did you then provide a configuration file (using the --config or -f parameter)? If not then it defaults to listening on all interfaces.
The default configuration file which is used when starting the daemon with systemctl defaults to only listen on localhost preventing it from being available on the network. This is fine if you intend to connect to the server using a tunnel.

MAMP - storing Database online?

I am wondering if it is possible while using MAMP to have the database online?
I am developing a couple sites locally between work and home, and initially thought I could get mamp to store or point to my external drive. No bueno.
SO am thinking I can still run mamp at work or at home pointing to my external drive but the DB that it would connect to would be online?
Depending on your system you could set up an SSH tunnel to another computer running the database. SSH tunneling allows you to direct a port on your computer (For example port 8889 which MAMP uses by default for the MySQL port) to a port on another computer. If set up correctly, you tell MAMP that you are using local port 8889, but ssh will then direct all traffic to the remote computer's mySQL port which is where you could run your database. This link has a good tutorial on how to do this provided that you have ssh installed.