cannot connect remotely with online database on localhost phpmyadmin - mysql

i have configured the phpmyadmin's config.inc.php file and a drop down menu has appeared accordingly in localhost/phpmyadmin to select the server. But when i try to connect to the server it says:
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
i have added my ip address to the online host server in the cpanel and have access to the remote sql connection.
please help.

Most hosts block incoming connections to the MySQL server as a security measure. You'll have to ask your host about unblocking port 3306 and how to access your MySQL directly -- or run an API on your web host, which would have access to the MySQL server due to being on the same network, and access the database through that. For phpMyAdmin specifically, just install it on your web host instead of your local machine, then access it through the internet rather than localhost.

Related

Database is in localhost of server. How to connect with it remotely

My hosting site provided me phpMyAdmin on server's localhost. How to connect remotely to MySql using remote tool as Session Manager or MySql Workbench.
When i work database in my website i use hostname as localhost. So question is what to fill in hostname in workbench. I already tried hosting site ip address, but couldnt connect with database.
A screenshot
From the figure, you shared I can see you are using HeidiSQL software to connect with a remote MySQL server. Hostname/IP should be your hosting IP address provided by your hosting provider. You need to verify the port where your MySQL is running. Here you have set 3306 which is the default port. It could run on a different port. In the User and Password fields, you should use your username and password to login into your hosting server.

Remote MySql Database CPanel

I want to connect a remote MySql database from MySql workbench but I got an error:
"IO Error: [Errno None] Unable to connect to port 22 on or
xx.xx.xx.xx"
What should I do?
I already add my IP to remote host
when I delete IP that makes the error, then I'm trying to connect, that IP showed up again in my remote host
So how can I connect to my database from MySQLWorkbench?
How to Connect to a Database with MySQL Workbench
One tool you can use to connect to remotely connect to databases on your shared, VPS, or Dedicated hosting account is MySQL Workbench. MySQL Workbench is a free tool you can use to connect to your server databases from your personal computer. MySQL Workbench can be Downloaded for free at the following link:
http://dev.mysql.com/downloads/workbench/
You will want to use the Windows (x86, 32-bit), MSI Installer if you are on Windows. The file we are installing in this tutorial is the mysql-workbench-gpl-5.2.47-win32.msi file.
Once you have downloaded MySQL Workbench, you can install it onto your computer. After you have the program installed, follow the steps below to set up a remote connection.
Add IP to your Remote MySQL
In order for you to be able to connect to your databases remotely you will need to add your local computer IP address to the Remote MySQL in cPanel.
Steps to connect to your database remotely
Open MySQL Workbench.
Click New Connection towards the bottom left of MySQL Workbench.
In the "Set up a New Connection Dialogue" box, Type your Database
connection credentials.
The credentials will be like the following:
Connection Name: You can name this whatever you like.
Connection Method: Standard (TCP/IP).
Hostname: You can use your domain our your cPanel IP address.
Port: 3306
Username: Your cPanel username or the user you created for the
database.
Password: cPanel password or the password for the database user that
was created.
Default Schema: This can be left blank.
Click Test Connection.
Type your password and click the "Save Password in Vault" check box.
Click Ok.
MySQL Workbench should say "Connection parameters are correct". Click Ok.
Click Ok again to accept the connection settings.
Now under the SQL Development section you will see your connection listed in the Open Connection to Start Querying box. Click your newly created account.
Now you will see the databases list in the area on the left.

How to connect to otrs MySQL database using mysqlworkbench

We have a Linux Vm which is running our OTRS. I have found the kernel file which has the database configuration details. In there the host name is listed as local host.
I tried using the server IP address along with the database username that is there; however I cannot seem to connect.
I also cannot find the port that is utilized. How do I connect to the database on mysqlworkbench,
Maybe server doesn't allow remote connections to the DB or user used by OTRS is only a local user?
If this is true you've got two options:
Create user that is allowed to login remotelyCreate user that is allowed to login remotely
Create user that is allowed to login remotely
Use Standart (TCP/IP) over SSH as connection method in MySQL workbench. This option allows to first connect over SSH to the server and than connect to the DB as local user

MYSQL Workbech connection to local network database?

I'm trying to setup a new connection in MySQL Workbench to MySQL server on my other network computer named say: SERVER
Hostname: SERVER
Port:3306
Username and password I leave blank.
I'm getting "unknown server host"
SERVER has dynamic IP.
How do I provide the correct Hostname?
I don't think that you can connect to a computer of your network with its name only in MySQL Workbench.
So, if you can't allocate a fixed IP with DHCP to your computer running MySQL maybe you could use port forwarding in your router config (localhost:port -> computer2_ip:mysql_port) so you will be able to connect to localhost:port in MySQL Workbench. You could also create a tunnel between the two computer but I think this is rather a question for ServerFault.

MySQL localhost confusion connecting via sequel

I'm trying to connect to my MySQL database using Sequel-Pro and I'm kinda confused what to use as my host. My hosting provider only gave me 'localhost' as my host then some user and password.
Typically you cannot connect remotely to DB a hosting provider will give you. There are a few that allow, but on shared environments (Dreamhost for example) but generally they wont allow you to as it is a potential security issue.
What sequel thinks you are trying to do is connect to your local computer (which localhost and 127.0.0.1 should resolve to). IF you are trying to connect to the remote DB of your hosting provider then you would need the public IP address or domain name of their DB server, not localhost.
If your provider does not offer remote DB access but does offer SSH access, you can use the SSH tunnel option in SequelPro to connect your host over SSH and then access your DB over that connection.
Sorry localhost is your local machine which is lookup on 127.0.0.1. Contact your provider again to acquire the correct host or IP address of the server hosting the MySQL engine. If they require you to connect via SSH, ask them for the right connection details and instruction.
I would assume that the hostname "localhost" is referring to the database from the application running on your hosting providers system.
If you use localhost from your own computer it will try to connect to a local database, on your own computer. (localhost is just a hostname translated to 127.0.0.1 by the hosts-file on your system)
You need to have a valid hostname for the database, please ask your provider if you can access the database from a external host and have them send you a real hostname.