on my Windows 10, I have Apache-Superset container running on Docker Desktop.
and also I have installed PostgreSQL ver.12 and myQSL ver.8 too.
now, in the SQLAlchemy I cannot connect to any of them! adding a Database/Datasource
I've tried many ways, in Superset Doc(s) and other forum suggestions too.
postgresql://username:password#localhost:5432/dbName
postgresql://username:password#127.0.01:5432/dbName
mysql://username:password#localhost:5432/dbName
mysql://username:password#127.0.01:5432/dbName
every time I get this error:
ERROR: Connection failed, please check your connection settings.
I just need an empty Database to be able to add a CSV file to.
many Thanks! in advance.
this is definitely a complex and unique setup! (Superset isn't supported on Windows, so Docker is definitely the way to go if you need to use Windows).
The main thing to understand is that the networking for your windows database server is different from the network within Docker. This is a common confusion actually, but Docker has some escape hatches for you:
https://docs.docker.com/docker-for-mac/networking/#use-cases-and-workarounds
this is the Solution!
instead of "LocalHost" or "127.0.0.1" for addressing the Database-M.S.
you should put this: "host.docker.internal"
that's all.
Related
I'm using wsl2 on a windows machine. I want to view my databases that I have on mysql server ubuntu in a GUI such as mysql workbench (on windows) but it seems as the two are not linked. In the pictures provided you can see that when I login to root, it displays different databases, I also use different passwords for root on both servers. When I try to use the root password from the ubuntu server in workbench, I get the error that I cannot connect to the database server.
Ubuntu databases
MySql workbench databases
MySql workbench config
MySql workbench error
UPDATE 2022
I found myself in this same need, and found a good resource that tackles this issue rather nicely. The solution itself predates even this question, funnily enough.
Long story short, check the following GitHub repository. Instructions are available and I can confirm it works on Windows 10.0.19041.1415 and WSL2.
https://github.com/shayne/go-wsl2-host
========================================================
WSL doesn't use the same IP as Windows, meaning you can't access it using localhost. Also, WSL IP changes everytime you boot it, meaning that the credentials for the connection will work only once.
In the sister community SuperUser, this has been discussed and some workarounds are avaliable, but I can't tell if they will work specifically with MySQL Workbench, as they ofter require you to use PowerShell/CMD.
Please, refer to the following discussions, which also provide further sources on the topic (There is one in particular that might be useful if you are running Windows 10 Pro).
Make IP address of WSL2 static
localhost and 127.0.0.1 working but not ip address in wsl windows 10
There are several requests to allow us to set WSL IP statically, so we can register it as a host in Windows DNS Host file and use that alias instead of the IP while setting up a connection (or use the IP itself, since it would be static anyway), but it is not ready yet AFAIK.
After reading the answer from #Jetto, I thought you could create a batchfile like this:
#ECHO OFF
wsl export wsl=$(hostname -I); sed -i -e "s/172.[0-9]*.[0-9]*.[0-9]*/${wsl/ /}/g" /mnt/c/Users/*username*/AppData/Roaming/MySQL/Workbench/connections.xml
This will replace the ip-address to the current ip-address of your wsl instance (relying on the fact that is starts with 172.)
If you start MySQL Workbench after running this script, you should be able to connect to MySQL (or MariaDB) which is running in the WSL2 session.
Disclaimer: I am not responsible for the fact that you did not make a backup of the file connections.xml 😉
P.S. In case you wonder: Yes this instance on my computer uses port 3356. But 3306 should work too if you do not have a local MySQL running.
Despites I've already installed XAMPP, I am trying to upload my database via MySQL server 5.7.17 since it's too big but both it and XAMPP use the same port - 3306. MySQL server is not even allowing me to continue to install it unless I make a change
SOrry, I'm a newbie.
Screenshots
Note It was suggested to me to download MySQL Server since I had already installed XAMPP but it didn't help me to upload my database.
No. If port 3306 is in use by an already installed and running MySQL instance, then another MySQL instance cannot use that same port. It is possible to run MySQL on a port other than the default 3306. But before we go there...
I think we might be barking up the wrong tree, trying to install another copy of MySQL and to run two instances of MySQL. Maybe we are wanting to run a different version of MySQL, other than the version other than what is included in the package we already installed.
But back pedal a bit here.
How is it that we reached the conclusion that installing another copy/version of MySQL was a viable solution to the problem we encountered?
It seems like we want to figure out the root cause of the original problem, before we chase down the wrong rabbit trail...
I am new to WordPress, and I am trying to setup it at my local machine.
I am getting error like "Error establishing a database connection".please help me to solve this error..
Without your database code, it is hard to figure the exact reason.
The error is usually due to:
Your MySQL server is not running. So you need to run this command if you are on a Linux machine (May not work for Ubuntu):
/etc/init.d/mysqld start
Or,
The MySQL user does not have the privileges to access the Wordpress
database
The port 3306 is blocked. Check what other program is using that
port.
The host name in Wordpress configuration is not correct. Make sure it
is 'localhost'
This is not exactly the proper way to address the problem, it's invaluable to learn how to navigate and work with the wp-config file, Apache, and MySQL - but this should solve your problem, and is very friendly for someone just getting started with this sort of thing.
The correct fix (in my opinion) is to set up a WAMP server, or at least Apache, MySQL, and PHP to run Wordpress locally.
You probably are looking for something more like: http://www.instantwp.com/
I have used it before. Basically, you install and it creates a virtual temporary server where you can develop without needing to mess with the details of Apache, wp-config, or SQL. Very easy, hope that helps. Cheers.
I've tried everything under the sun to fix this problem, nothing works!
I'm trying to connect to mysql using node.js.
I've tried both normal connections and pool connections, but I keep getting the following error:
"connect ECONNREFUSED"
I'm working on a Windows 7.
There are many similar questions to this on Stack Overflow, and everyone mentions the mysql configuration file (and commenting out "skip-networking"), however, I can't find where the file is (the mysql module was installed under node_modules).
I've tried looking for my.ini and my.cnf, there don't seem to be on my machine either.
Is there a way to try to log in to mysql via the command line?
It seems like there isn't since the command line doesn't recognize the command "mysql".
I'd post the code that I've been using but that wouldn't help, since I've been using dozens of different alterations, and all fail.
Thanks in advance, I appreciate the help!
Thanks to Салман, I realized that I need to install the actual MySQL server as well.
I installed MySQL server and everything worked fine in command line. I worked connecting MySQL to my ASP.NET application and there is no problem at all. But when I try to connect MySQL to PHP applications I am unable to connect. When I installed PHPMyAdmin I am getting error #2002 Connot log in to thie MySQL server
I browsed all the night for this error and none of Google's results helped me! :(
Anybody can you please tell me where the problem is at? I believe I must change my PHP.ini file settings in order to connect to MySQL. Anybody please help me.
There are a lot of things that can cause this type of issue. Did you make sure that you have added php-mysql drivers to your sever. Since you said your using ASP i will assume that you are using windows servers. Make sure that you also are allowing that user to connect via localhost or what ever ip the PHP is on.
In php there are to standered ways of connecting to a MySQL database.
php-mysql(is going to be depercated soon).
php-mysqli(OOP version of the php-mysql with lots of features).
With out one of these php will be unable to work with a MySQL database. I am not sure if phpmyadmin works with both drivers or just one of them It could be throwing a die("message") Just to let you know it is not working instead of throwing a more complex php error. You may want to see if you can incress error reporting.
You can check if your php installastion has the mysql driver by looking in your php.ini and also checking with.
phpinfo();
It is almost always about config. https://bbs.archlinux.org/viewtopic.php?id=90133