Good day,
I have a VB application which i need to connect its database in xampp/mysql..
But mysql/xampp is installed to other computer which is networked at my computer.. What will I do?
The MySql server with XAMPP is no different to any other MySql server , with the exception of the interface; it looks a little bit different. If you want to be able to connect to the server, you need to know the server's internal IP address (you can find it with CMD > ipconfig). The port will generally be assigned to 3306, so you shouldn't have any issues there.
If you want to grant access to the server from your computer, open up the XAMPP control panel (from the other computer) and click Shell. Type in MySql and you'll be able to execute commands, from there (which you can use to grant remote access).
Related
I have been building a website for a project using XAMPP. It has a database for users to register which stores their details. I was going to test my website with my friends by physically giving them my laptop however due to coronavirus I can no longer do so. As a result, I have had to upload my website to my university server for people to access the URL, however how can I reconnect this with my database that is on my XAMPP?
The code that I'm not sure how to alter is here and this is in a php file on my uni server (this may not even be the correct code to alter):
$db = #mysqli_connect('localhost','root','','databasetable') or die ("Could not connect to server");
OR
Is there a way for people to access my XAMPP files on my machine remotely for my friends to test the website and be able to make a log in etc.
Thanks in advance :D
You can expose your localhost databases by using tools such as http://ngrok.io/.
The command ngrok tcp 3306 will create a secure tunnel that can be used in your code.
There is a server I wish to connect to. It has multiple VMs running on it each VM has a mysql DB. I can currently connect to this server using ssh and then connect to any of the databases from each VM using mysql -u user -h host -p password. Now I want to connect to the same MySQL DBs using MySQL workbench from my local machine. However there is firewall, currently I use putty to get passed the firewall with public private key authentication and I can access any machine I want. I have seen here that I must install a MySQL server locally ( I've done this I am using mysql workbench) and use the loop-back address, in that way you don't need to access an external server. Could anyone point in the right direction on how to do this?
You need to use ssh tunnelling.
In putty under the options go to Connection->SSH->Tunnels. Add a tunnel from source port 13306 to Destination localhost:3306.
You can do this in Putty either before or after you connect. It's best to do beforehand and save the session configuration otherwise it gets tedious having to re-enter the settings.
In MySQL workbench connect to localhost port 13306.
There is a good guide with screen shots here: Setting up an SSH tunnel with PuTTY
An SSH tunnel makes a TCP port on your SSH client machine and directs any traffic to whatever the destination is set to. You can add multiple tunnels, but each one must listen on a different source port number.
You can forward the port via SSH.
ssh -NL is your friend like so:
ssh -NL 3306:localhost:3306 <yourserver>
Then you can point your workbench at localhost.
You don't need any additional software for this task. MySQL Workbench can create SSH tunnels on its own. Watch my tutorial on Youtube how to create connections: https://www.youtube.com/watch?v=DCgRF4KOYIY.
It essentially comes down to creating the right connection type. There is a drop down that allows you to select an SSH connection. Enter the parameters which you used to connect via Putty.
I am currently programming a launcher in Visual Studio that gets the version history from a MySQL server. I have run into an issue where I cannot connect to the database if I use a public login for the database. If I use the root login I can connect on my local machine but no other. This is what I am using with subins to protect my data:
"server='serverip';user='severusername';password='serverpassword';database'databasename'"
If I use the root password, it will connect on my local computer. If I use my godaddy hosting database, it will also work on any computer. The MySQL server I am connecting to is on my local computer and running WAMP. Does anyone know a way to get it to work? My user has full permissions. This is programmed in Visual Studio using Visual Basic.
It appears that you have a typo:
database'databasename'
Should that not be:
database='databasename'
Also, it could be that godaddy does not allow remote connections for MySQL so when you try to connect from your local WAMP installation to their remote MySQL server the connection is denied. This is more than likely the case as the bandwidth cost for this can become quite huge very quickly. You should however be able to run things in the shared hosting environment using localhost as the server/hostname.
I fixed it by adding 2 cases of my user. One with a host of localhost and another with a host of 127.0.0.1
I am not sure if the terms I am using are correct so ask for clarification if you need :).
Anyways, I am hosting through HostEasySolutions (Server A). It comes with a MySql database, using PHPMyAdmin as the frontend. On Server A, I added some PHP files to access the database, and it works fine.
If I copy the php files to my other server, through DreamHost (Server B), I cannot connect to the database. I get the error: Can't connect to MySQL server on 'combinedsystems.ca' (110)
In the cPanel on Server A, I added the IP for Server B into the Remote Database Access Hosts, I also just added the wildcard '%', just to see if I could get it working...but still it can't find the server.
I am not sure what is going on, as far as I can see there is no firewall.
The only thing that stands out to me, is that if I go to PHPmyAdmin for Server A, it says Server: Localhost via UNIX socket, where as for Server B's PHPMyAdmin, it says: Server: mysql.pdem.info via TCP/IP
Most (all?) hosting companies have port 3306 closed on the firewall.
What you need to do:
adding remote database access in the database
edit my.cnf to listen on all interfaces. Default mysql listens only to localhost
most of the time you are out of luck! Even if there is no firewall (would be very unsecure) you have no access to my.cnf
I have developed a web application that uses PHP and MySQL and has all been running fine from a single development server. I now want to separate things a bit and place an app server within Amazons cloud that will receive and process uploaded files. The database is going to remain on the dedicated server but will need to be accessed by the EC2 instance.
Heres what I have tried so far...
In phpMyAdmin I added a new user to the privileges table. I gave it the elastic IP address from AWS as the host name, a new password and granted privileges to INSERT, SELECT and UPDATE.
In the PHP scripts on my EC2 based app server I included this username, password and the domain name of the location of the mysql server (example.domain.net) when connecting with mysql_connect
I have a simple test page that tries to SELECT and echo some results from the database but get the following error -
Could not connect to MySQL: Can't connect to MySQL server on 'example.domain.net' (4)
What could this mean, what have I missed, are there any other issues such as trying to do this from within EC2 that will cause other problems?
cheers all
Turns out the only other thing I needed to do was to open port 3306 on the database server to allow access. Did this by going to Control Panel -> Windows Firewall -> Exceptions -> Add Port ["SQL", 3306]
Now it works great!