• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How to allow external connections???

C

canton

Guest
Hi all

How do i allow external connections for me to connect to my MtSQL databases (specs - FC4 Plesk 8)

thanks:)
 
mysql (on a plesk install) runs on port 3306, so make sure that port is open.. you can is check this by running nmap (you ip) from the root directory of a different server.

Then simply go into plesk click > database servers > new database and input ip address and pass etc..
 
thank you. I found out that my virtual server by default doesnt allow external connections.

But my hosting company gave me these instructions to enable permission. Big problem is when i get to section 5 of the instructions, i get the error in shell "command not found".

How to Enable remote access to MySQL

: This document is valid for 1&1 Web Hosting 5.0 but not for 1&1 Microsoft Hosting.
Linux Root Servers only!


As default, 1&1 dedicated Root servers come with the MySQL remote access disabled, this is for
security reasons, as it can be a security risk for the Server. If you would like to enable this
access it is done at your own risk and 1&1 take no responsibility for any damage cause as a result
of enabling this access.
Step 1 Firstly you will need to log into your server's shell via SSH. (For more information on how to access your server using SSH please see this FAQ :Remote Server Access Using Secure Shell (SSH))

Step 2 Once connected you need to open this file "/etc/my.cfg" this can be done using the command
vi /etc/my.cnf

Step 3 You will see a few lines of text. Comment out the 'skip-networking'
[mysqld] default-character-set=latin1 datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-innodb #skip-networking <---- MAKE SURE this is commented like this with the # preceding. [mysql.server] user=mysql basedir=/var/lib [safe_mysqld] err-log=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid

Step 4 Save and Close the file.
Step 5 Now you will need to log into your MySQL Database via the shell you have open.
To do this type the following command into the shell.
root@pxxxxx:~ mysql -u admin -pXXXXXX


This will log you into the MySQL database
Step 6 Type the following in:
mysql> use mysql;

Step 7 Next you will need to grant access to the database, this will be restricted by IP.
To do this use the the following commands, replacing the IP addresses and Database Names.
mysql> update db set Host='123.123.123.123' where Db='yourdatabasename'; mysql> update user set Host='123.123.123.123' where user='yourdatabaseUsername';

Please note
Replace 123.123.123.123 with your connecting IP address.

Step 8 Logout of MySQL with the 'exit' command.
mysql> exit

Step 9 Next restart the mysql database with the command :
root@pxxxxx :~ /etc/rc.d/init.d/mysqld restart

Step 10 Now test the connection with telnet from your local machine, by typing
telnet yourserverIPaddress 3306 and it will connect to your server at this port.

:) :)I must say that my hosting company hasn't been helpful as the technical staff doesnt have a clue so your help would be greatly appreciated
 
Actually you received the right instructions for your problem. You may also check that your firewall ( if you have any ) doesn't block INPUT connections to port 3306.
 
Step 5 is correct, but I think you might have misread it. All you should be typing in is:
Code:
mysql -u admin -pXXXXXX
where XXXXXX is replaced by your Plesk Admin password.
 
what a newbe mistake. i did missread it. will tell you how i go later when i have a chance.

thanks again
 
it worked i can now use my external software to connect :) but i now have a major problem. my script on my website that is using that database cant connect now. Its as if if given permission for me to be able to access it but not my local site. This is the error that my script gave me on the website.


---------------------

SQL error: Access denied for user 'user_name'@'**.***.***.***' (using password: YES)
SQL error code:
Date: Saturday 20th of January 2007 04:29:18 AM

----------------------

what could i do to change this?
 
Back
Top