Trying to access XAMPP database from another domain - mysql

I just need some help with accessing my DB. I'm moving my websites from XAMPP to a hosting provider is there any way of allowing XAMPPs MySQL DB to be accessed outside of its IP. When I tried to do this I cant a simple Connection Refused error.
I need to use the XAMPP DB because a python script I have for some reason doesnt work with my hosting provider DB.
'Localhost' XAMPP Server DB ---DATA---> 'www.example.com'

Related

Flutter MySql Connection with Plesk Server MariaDB

i got a Problem with a MYSQL Server Connection, i looked to much Videos on Youtube but its making this only with Localhost, i got a Plesk Hosting and a IP Adress, i tested the mysql1 Package from pub.dev but its not also working im getting Problem as ,
has anybody know how can i connect a Database and get Data from Row ?
I changed also Plesk Settings as Remote Connection Allowed to Database.
Thanks.

How do I connect a to a mysql database hosted on pythonanywhere?

I have bought a basic 6$ pythonanywhere server which allows for SCP and SSH connections to their servers. I have deployed my flask application (REST API) to the server and set up a local environment (installed packages, set up path and environmental variables). I ran the app, and it gives me the 404 page on the / route which is actually a sign that it is working.
However when I try to hit a route like /api/users/3 for example, it gives me an error 500 (internal server error). I dug around some log files on the server and found one which is basically the output of the WSGI web server which is host to my flask application. It said that there is an issue with the database communication. From what I understand, it connected successfully but it couldn't query the data from the table:
(1044, "Access denied for user 'secret_username'#'%' to database 'test'")
I have tried to fix this through the web mysql console by giving my <secret_username>#secret_username.pythonanywhere.com all the privilages to test.*, but it gives me an access error once again. I tried to SSH into the machine that is host to the mysql server and tried to connect to it - secret_username.mysql.pythonanywhere-services.com but it doesn't allow me to ssh into this server.
Has anyone experienced this issue? I am almost sure that my connection is set up correctly because if it didn't establish connection it would give me an access error with message `using password "yes". I've read on forums a bit, they suggest installing a mysql server on the same server as the flask application, but I don't have access to sude for some reason, probably due to my cheap plan. Any ideas?
If you are using the MySQL database provided by PythonAnywhere, with the hostname secret_username.mysql.pythonanywhere-services.com, then your database will be called secret_username$test, not just test -- see the "Databases" page on the PythonAnywhere website.

Connection failed in using mysqlconnector ODBC to connect from sql to access

I am trying to connect mysql database in phpmyadmin to the access file. I am using mysqlconnector ODBC for that. Tutorial I am following is this
The problem is that when I give the credentials to connect to database, it gives me error as shown in this snapshot
I have tried hard to search on internet but failed. What mistake I am doing. I am putting the ftp information of the server there. Is there any database credentials i need to put?
You can't use the FTP credentials to connect the MySQL database. You have to use the database credentials. Make sure you have done followings before connecting.
Make sure MySQL server is up and running on the HOST IP and PORT.
Your MySQL server can accept connections from your IP or use % for
all IPS
Make sure you have a valid USER account
EDIT
Or tell us where(local server, internet, IP) the MySQL database is installed. The port number the server is listening on. How you access MySQL server normally.

OperationalError Lost connection to MySQL server at 'reading initial communication packet' DigitalOcean

Im having trouble connecting to my sql server on digital ocean through my flask webapp. Im using flask-sqlalchemy to bind the mysql database to Flask.
Im able to access the mysql server through the phpmyadmin interface at myipaddress:5000/phpmyadmin
Since Im using Nginx (I bound it to port 80). Bound Apache to Port 5000. So my phpmyadmin interface is accessible at
myipaddress:5000/phpmyadmin
In my flask app, i specify the
SQLALCHEMY_DATABASE_URI ='mysql://root:password#myipaddress:5000/databasename'
when i try to create the tables on my database using the shell with db.create_all() - it just doesnt respond. The cursor blinks forever and then i get the operational error that i quote on the title afte a few minutes
Im able to get the same setup running on my local dev machine. So i know its not a flask configuration problem but just a mysql access issue. I have my webapp up on digitalocean (Not sure if mysql server is behind a firewall or something like that making it inaccessible
On the
/etc/mysql/my.cnf
for the bind-address under mysql_d section, i tried all possible combinations and restarted the mysql server with no success
i tried localhost, 127.0.0.1, 127.0.0.1:5000, myipaddress for the bind-address (Also tried commenting it out) without any results.
Also i tried to get the user, current_user on the table properties from the mysql command line, it's listed as root#localhost for both
From this post:Lost connection to MySQL server at 'reading initial communication packet', system error: 0; i get the idea that its related to firewall but not sure how to rectify this.
Anyidea how can i connect my flask app to the mysql server ? Any help would be much appreciated
I was specifying the mysql address as
mysql://root:password#myipaddress:5000/databasename
But since my flask app and the mysql server are running on the same server, the flask app was be able to access the mysql server when i replaced the myipaddress:5000 with localhost:5000
mysql://root:password#localhost:5000/databasename
The phpmyadmin is just a web interface for your database, if you're looking at connecting your Flask application to your MySql database, you need to point the SQLALCHEMY_DATABASE_URI to the actual MySQL database, rather then the web interface to that database.
Usually MySql runs on port 3306. I believe that SQLAlchemy is clever enough to know that's the default, so your connection string should just be: SQLALCHEMY_DATABASE_URI ='mysql://root:password#localhost/databasename' or if you are running on a different port/external IP address: SQLALCHEMY_DATABASE_URI ='mysql://root:password#myipaddress:4444/databasename'. Remember, if you're connecting to a MySQL database on an external server (not the same one as your Flask app is running on) you will have to change the configuration to allow that kind of access.

connect to mysql database using visual studio 2010 remotely

I am trying to connect to MySql db using VS2010. I added my ip address in cpanel allow hosts. I also grabbed the IP address for the server where the database is hosted which is just my website.
So I go to server explorer, right click database connections and clicked on add a connection
I select .NET Framework Data Provider for MySQL for Data Source
for Sever Name I typed the IP address for my website where the Database is
Typed in the user name and password who has all the privileges, and entered the Database Name too.
When I hit test connection I always getting "Unable to connect to any of the specified hosts"
any advice is appreciated
Thanks
So, in order to connect to a MySql database from VS2010 see the link bellow:
http://www.itcsolutions.eu/2010/09/09/how-to-connect-to-mysql-database-from-visual-studio-vs2010-problems-with-net-connectors/
Have you tried adding % as your access host under Manage Remote MySQL Access of your Cpanel?
Try this
http://zambalestechrealm.wordpress.com/2012/03/08/vb-net-remote-access-to-mysql-database-of-my-website-2/
It says
Goto Your site Cpanel, and look for MySQL remote access, in my case i put % in the list of user to access remotely to my database. ‘%’ percent means to allow all connection to connect to my MySQL database.