I am hosting a site on 1and1, and having trouble connecting to a MySQL database.
I am very new to MySQL and PHP, so I'm not sure I did this right.
Under my domain,
choose Web Space>MySQL Administration
(get taken to PHPMyAdmin)
New Database
Once DB has finished setup,
use "host", "username" and "password" given by 1and1 to connect Dreamweaver.
I tried doing this, but Dreamweaver gives me an "Unknown error", which doesn't help at all, as it doesn't even give an error *code.
It's pretty common on shared hosting to allow db connections only from apps running on their servers. Connections from other clients are blocked/rejected.
If you are able to connect your Dreamweaver to a local (on your machine) MySQL server, then it's probably the case that 1and1 is blocking your remote access.
1and1 do not permit external connections to the databases
You should still be fine to connect with dreamweaver. That error you get is usually because the publishing URL (usually the same as default www.domainnamehere.com) hasn't been configured in DW under the Testing Server section yet.
Related
I'm doing this for a couple of years now but I haven't faced anything like this. I'm renting a webserver which has MySQL storage. For security reasons the hosting company refused to give me a host name to connect to the MySQL server from a php script. The reason was that there is an IP filter on he server and one can only connect to it with a whitelisted ip. Is there any solution for this situation like a server sided proxy? Also I do have access to the MySQL server via phpMyadmin.
I did some research and I've found that Navicat has proxy support. Altough it's not free.
Based on your description, it sounds like you have a server with MySQL, PHP and phpMyAdmin all running on the same server. If that's the case then typically the hostname for MySQL will be "localhost", possibly with a port or other code added. It is quite common for web hosting companies to not allow remote MySQL access, though the good ones will have it off by default and let you turn it on either for specific IPs (best) or for "everywhere".
When you are logged into phpMyAdmin, take a look at the very top of the main window and you should see something like Server: localhost or Server: www.example.com:3306 - that is your hostname for any MySQL access, provided the PHP code is running on the same server as phpMyAdmin.
If you actually need to run a program on a different server and access that MySQL database then you are probably out of luck.
I am trying to connect to a mssql database hosted on a different website than the one I am connecting from. The basic syntax of my code is
$db = mssql_connect($server, $username, $password);
and I get the error
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: *ip* in *filename* on line 41
I am using a Namecheap shared hosting account to host my site. I had to go into the php config to enable the mssql module.
According to this Namecheap support page
Remote MySQL connection is disabled on our shared servers due to security reasons
So my question is is my error due specifically to my site being on shared servers? Is that quote referring to connections going out from the host, or does it mean connections coming in? I would think that it wouldn't let me use the Mssql module at all on the shared servers if it was literally impossible to use it.
I suspect that the connection issue is due to NameCheap's block of mysql. You can check the logs MySql log man page for more information about your MySql errors. If they are blocking it, there's no amount of PHP code you can write to overcome this. NameCheap has great customer support, you can do a live chat to ask them.
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 have a WordPress website, which is not done by me, all I need to do is connect to its database remotely and query some results from its database. The point is that I don't know anything about WordPress, and I saw that the database information are written inside the wp-config.php file, when I opened it, there was the username and password, but the host name was this:
define('DB_HOST', 'localhost');
Which seems a bit curious to me. The website uses cPanel X from GoDaddy, and when I logged in there and opened phpMyAdmin, it had these information under database server part:
Server: Localhost via UNIX socket
So, I really don't know how to remotely connect to the database and query things, because host name says localhost. I'm used to ASP.NET MVC, and where I specify the host name to be the actual server ip or hostname of the database server. Any idea how should I proceed?
This is probably a better question for superuser as it's technically a hosting related question. That being said, you would need to contact GoDaddy and find out if they even allow remote MySQL connections on their servers. Most hosting companies disable external connections to the MySQL server on port 3306, but if you portscan your domain name/IP and see 3306 open then you can probably remote connect to it. Just use the domain name/IP of your site as the host, and pull the user/pass/db name from the config file.
You can do this by using command line.
GRANT ALL ON wpdb.* TO wpuser#`192.168.2.25` IDENTIFIED BY `Pa55w0rd!`;
Check here for a detailed tutorial.
I have to migrate the files from a website in Wordpress to a new server, however I would like the database to stay on the old server.
I tried to 'wp-config.php' change 'localhost' to panel PHPmyadmin: 'http://admin.*****.com/mysql/' put me back: Error Establishing a database connection.
the users and passwords'm sure that is correct, the url I'm not sure, Its possible?
Thanks.
If on shared hosting, you most likely have to enable 'Remote MySQL' to allow for external connection to the database. Check with your host to see if you have access to this feature or for documentation.
GoDaddy Connecting Remotely to Shared Hosting Databases
Hostgator
If the database stays on the old server you have to change localhost in the wp-config.php on the new server to the MySQL-Server-Address of the old server