MySQL - change connection to MysqlWorkBeanch - mysql

I have a server at Amazon with my Database and I usually acess by hpMyadmin with no problem, but I hate that. I downloaded the MYSQL WorkBench but I can't connet to my server, anyway. I am always receiving the same message as follow:
Connecting to MySQL server ... Can't connect to MySQL server on (10061)
Someone, did have the same problem or known how to do?
Thank you.

Most providers allow access to database only from they local network. Databases aren't visible from the internet. The reason - security.
Server with phpMyAdmin is located in their internal network so it have no problem with accessing to database, but your computer is on the outside and DB isn't visible for it, hence the connection error.
If you have ssh(or vpn) access to machine (but you probably don't) you can create tunnel and access your DB through it with workbench.
On the other hand, you should be able to upload your own web client, different than phpMyAdmin e.g http://mywebsql.net/

Related

How can i grant access to mySQL database to other computer within my house?

I'm a beginner in SQL so i'm sorry if the question is too basic.
I just created a database in MySQL Workbench in my computer and i would like to be able to access and modify the database from another computer within my house. I read some solutions but they all require using some external product, is there a way and how can i do this by the MySQL Workbench GUI, or maybe other functionalities from MySQL?
I also installed MySQL community server on the other computer that i would like to connect my database to.
Thanks!
If it's a home network, and both of you are connected via same router, then you can connect to mysql server on the other device using http://ip_of_machine_running_mysql:3306.
ip_of_machine_running_mysql should be the ip of the machine running mysql server.
Worth to note that you need to allow remote connection to mysql if you haven't already done so when you were doing mysql installation.
The steps for enabling remote access differs for your os(windows, ubuntu, mac), but you can easily find tutorials and how to's for changing such configuration.
https://www.brightfunction.co.uk/connecting-to-mysql-server-across-a-local-windows-network/
https://www.techrepublic.com/article/how-to-set-up-mysql-for-remote-access-on-ubuntu-server-16-04/

old web host doesn't have phpmyadmin, remote access?

A new client of mine has a site hosted on netnation (boo). Their account manager doesn't have a way to access phpmyadmin or anyway to access the database. I'm not a programer, I'd just like to be able to view a stored password so I can give it to my client. I have the database host, user, password, and database name in the php files of the site.
Is there a program that I can use to view the database? No command line please it's not my thing and I'd probably break something.
Thanks
Most live databases don't allow direct access from outside the server, so if you're unlucky it can't work unless you can configure mysql to allow access from remote clients, too.
But at least you can try. Just configure any phpmyadmin installation (locally or on another server) to connect to that database. You do that in the file config.inc.php in the phpmyadmin root directory.
Look for the line that says "$cfg['Servers'][$i]['host'] = 'localhost';". Just replace 'localhost' with the url or IP your database is running (usually the same as the website). If your mysql allows remote access, you should be good to go. Otherwise you will have to re-configure your mysql installation first to allow that.
MySQL Workbench is a GUI program that allows access to MySQL database. It can work directly or using SSH. Most likely you won't be able to connect directly so your best chance is to get SSH access and connect using it. If it's not an option you can get FTP access and install phpMyAdmin (simply by uploading it to server).
Also, it's considered a bad practice to store password in DB, so it's very likely that the password itself is not stored, just its hash.

How exactly am I accessing the host/server through localhost on phpMyAdmin?

I am working on a school project in which I have to upload data onto a database hosted on phpMyAdmin.
What's confusing me right now is that I see "localhost" at the top of the page and before I even query the database I see "Run SQL query/queries on server "localhost":"
Does this mean that I'm hosting a server on my computer and accessing the database through that? Because then I query for "SHOW VARIABLES WHERE Variable_name = 'hostname';" and it returns with hostname = webhost330. (It is hosted on webhost330.asu.edu).
I'm extremely confused about what this means. Thanks for any possible help.
I'm very new to databases so forgive me if I'm missing something simple here.
EDIT: To clarify: I'm not at school, I'm at my house. What kind of implications does this have? In other words, what's the difference between this and hosting a database locally?
When I host a database on my computer through the MySQL command line client, I can create database information and it's stored on my computer in files. Does this mean that it's initially stored on localhost and then that data is used to create files on my computer?
And then the equivalent of that for the webhost330 is that the localhost stores the database initially but then uploads it to the host at phpMyAdmin? That is the primary thing I'm confused about.
This exactly means what you assumed. When connected to localhost, you are connected to local MySQL server on same machine. Using webhost330.... you are connected to that remote MySQL server instance, if that is not the name of your own machine. Your own server can be webhost30.etcetc.
Edit
If your website is hosted here: webhost330.asu.edu then MySQL host either being webhost330.asu.edu or localhost both mean the same local MySQL server on your very machine.
Edit based on your update
If you are at home, then localhost means you are connected to a MySQL server that you have installed on your own computer. and webhost30.etc.etc means you are connected to the database you have at your school. Database do allow remote connectivity and if you are connected to school from home, that's a remote MySQL connection.
To remove your confusion, you should use only localhost in your code. localhost at home will mean the development server which is your home computer, and when you take the same code to webhost30.etc.etc then localhost for that server will mean its own MySQL installation. So localhost will work everywhere as long as you don't want your code to connect to a remote external MySQL database server.
Assuming you're at school, and assuming you're on your school network. Then yes, your machine is probably "webhost330.asu.edu". At the very least webhost330.asu.edu thinks "webhost330.asu.edu" is localhost.
To see what "localhost" refers to in terms of MySQL server, you have to look at the URL you are using to connect to the web server.
For example, if the URL is
http://localhost/phpmyadmin
and this instance of phpMyAdmin tells me that the MySQL server is on localhost, this means that the MySQL server is on my local workstation.
If the URL is http://example.com/phpmyadmin, then localhost will mean that the MySQL server is on the same machine (example.com).

Connect to MySQL local database via PHPMyAdmin

I have two servers running on Ubuntu. Server 1 only has MySQL installed and acts as an database. Server 2 is a Apache web server. The database is internal and so as the Apache server and they can ping each other but the database server is not accessible via the internet. I can telnet into the database server from the Apache but I can not connect to the database via PHPMyAdmin.
So the question is how I can configure this to work. I also don't want to allow access to the whole server (databases), access only via user name and password specified.
Thanks!
Define your user as user#[hostip-of-Php-myadmin-server] and you should be set?
It was a BIND issue, it's all fixed now.

Securely connect MS Access database front-end to MySQL back-end on web host?

We have a fairly simple M$ Access db, split into front-end (forms, reports, etc.) and back-end (tables). Currently looking for a way to get the tables with all the critical data off of one desktop and hopefully into a MySQL database on our web host, and be able to connect to it from multiple PCs (still probably only one or two people connecting to it at any give time), and eventually, hopefully, migrate to a web application when time allows. Many of the examples I've read about people connecting an Access db front-end to a MySQL back-end seem to imply that they are doing so on a LAN, probably behind a firewall, etc.
Is it at all safe to connect a M$ Access front-end to a MySQL backend when that mysql server is running on a remote web host? Does the ODBC connector take care of encryption?
TIA,
Monte
You could use putty to mount a ssh tunnel to your mysql server and redirect the remote mysql port to your machine.
Using putty is pretty straightforward:
Give it your mysql server dns name as the host and go to "Connection/SSH/Tunnels", there you define the local port to connect in the "Source Port" field (e.g. 3307).
In the the "Destination" field put the dns name of your mysql server followed by a colon and the port mysqld is running in (e.g. mysql.example.org:3306).
Save this as a profile then connect and the remote mysql port will be availbable locally on port 3307.
Just make sure you restrict the user because by default he will have an ssh shell on the server.
Setting up key authentication would also be practical because you won't have to enter a password to connect to the server (but be sure to protect your key on disk by encrypting it).
EDIT: It seems the mysql odbc connector support ssl, you could use that too but I'd personnally choose to use SSH anyway as you will have it already on your mysql server.