Jump to content

Mysql denies to connect to homepage


Recommended Posts

  • Premium
1 hour ago, Sneaky Sneaky said:

Hello,i have one issue

i installed mysql correctly port 3306 is open same as mysql service but homepage doesnt connect to mysql 

i saw some topics in freebsd forum about allowing remote connections through my.cnf but still

probably will be a firewall issue??

i am using freebsd11.0

 

https://stackoverflow.com/questions/14779104/how-to-allow-remote-connection-to-mysql

 

And please, if you have to do it don't do it on root.

Link to comment
Share on other sites

well , in freebsd11.0 the my.cnf is at /usr/local/etc/mysql

i have read all of that :D

still havent managed to get access.

my.cnf is like this:

# $FreeBSD$

[client]
port                            = 3306
socket                          = /tmp/mysql.sock

[mysql]
prompt                          = \u@\h [\d]>\_
no_auto_rehash

[mysqld]
skip-grant-tables
user                            = mysql
port                            = 3306
socket                          = /tmp/mysql.sock
basedir                         = /usr/local
datadir                         = /var/db/mysql
tmpdir                          = /var/db/mysql_tmpdir
slave-load-tmpdir               = /var/db/mysql_tmpdir
secure-file-priv                = /var/db/mysql_secure
log-bin                         = mysql-bin
log-output                      = TABLE
master-info-repository          = TABLE
relay-log-info-repository       = TABLE
relay-log-recovery              = 1
slow-query-log                  = 1
server-id                       = 1
sync_binlog                     = 1
sync_relay_log                  = 1
binlog_cache_size               = 16M
expire_logs_days                = 30
log-slave-updates               = 1
enforce-gtid-consistency        = 1
gtid-mode                       = ON
safe-user-create                = 1
lower_case_table_names          = 1
explicit-defaults-for-timestamp = 1
myisam-recover-options          = BACKUP,FORCE
open_files_limit                = 32768
table_open_cache                = 16384
table_definition_cache          = 8192
net_retry_count                 = 16384
key_buffer_size                 = 256M
max_allowed_packet              = 64M
query_cache_type                = 0
query_cache_size                = 0
long_query_time                 = 0.5
innodb_buffer_pool_size         = 1G
innodb_data_home_dir            = /var/db/mysql
innodb_log_group_home_dir       = /var/db/mysql
innodb_data_file_path           = ibdata1:128M:autoextend
innodb_flush_method             = O_DIRECT
innodb_log_file_size            = 256M
innodb_log_buffer_size          = 16M
innodb_write_io_threads         = 8
innodb_read_io_threads          = 8
innodb_autoinc_lock_mode        = 2
skip-symbolic-links

[mysqldump]
max_allowed_packet              = 256M
quote_names
quick

 

Link to comment
Share on other sites

  • Premium

Make a test account and connect to it on your pc.

 

If your pc connects to it, then your site is misconfigured (most likely)

OR

host of website is blocking port 3306 (unlikely)

___________________________________________________________________

If your pc can not connect to it, the user you're using doesnt have permission to access remotly ( % )

OR

Your ipfw / pf of the database host is blocking the port.

 

 

I assume (by the remote in your first comment) website is hosted somewhere else then the database, if thats not the case write it here.

Link to comment
Share on other sites

36 minutes ago, T4UMP said:

Just create user in navicat  ex. homepage@<ip domain> and try it.

dafuq?

26 minutes ago, tierrilopes said:

Make a test account and connect to it on your pc.

 

If your pc connects to it, then your site is misconfigured (most likely)

OR

host of website is blocking port 3306 (unlikely)

___________________________________________________________________

If your pc can not connect to it, the user you're using doesnt have permission to access remotly ( % )

OR

Your ipfw / pf of the database host is blocking the port.

 

 

I assume (by the remote in your first comment) website is hosted somewhere else then the database, if thats not the case write it here.

well i tried it on a website that i had an online server running from there didnt work so misconfiguration wont be because i also tried in 2-3 websites more.

Website Host not blocking i think 3306 because in same host i had my online server running

Same as vps hosting wont be blocking 3306 cause i can manage to enter to navicat

I gave through putty  & navicat permissions to root but still shit


as you told ipfw is blocking probably port.
If i disable firewall will be problem huge... i havent tried through cause idk how to disable firewall in freebsd11
Also idk how to permit remote mysql on freebsd11
thats why i posted here probably someone know the fix for this shit

 

--- i have in different host on website and server but when i asked my website hosting to whitelist this ip from theyr firewall they told me that is ok this ip
now idk what the fk is problem

Link to comment
Share on other sites

  • Premium
<?php
$servername = "localhost";
$username = "username";
$password = "password";

// Create connection
$conn = new mysqli($servername, $username, $password);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>


 

Link to comment
Share on other sites

1 minute ago, T4UMP said:

<?php
$servername = "localhost";
$username = "username";
$password = "password";

// Create connection
$conn = new mysqli($servername, $username, $password);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>

yes mate i have that one... i test it says connection failed

problem is that mysql is not allowed remote access

Link to comment
Share on other sites

  • Premium
2 hours ago, Sneaky Sneaky said:

dafuq?

well i tried it on a website that i had an online server running from there didnt work so misconfiguration wont be because i also tried in 2-3 websites more.

Website Host not blocking i think 3306 because in same host i had my online server running

Same as vps hosting wont be blocking 3306 cause i can manage to enter to navicat

I gave through putty  & navicat permissions to root but still shit


as you told ipfw is blocking probably port.
If i disable firewall will be problem huge... i havent tried through cause idk how to disable firewall in freebsd11
Also idk how to permit remote mysql on freebsd11
thats why i posted here probably someone know the fix for this shit

 

--- i have in different host on website and server but when i asked my website hosting to whitelist this ip from theyr firewall they told me that is ok this ip
now idk what the fk is problem

 

service ipfw stop

or

service pf stop

 

PM if still unsolved by the time you read this

Link to comment
Share on other sites

On 2/24/2019 at 10:22 PM, tierrilopes said:

 

service ipfw stop 

or

service pf stop 

 

PM if still unsolved by the time you read this

still unsolved

Cannot 'stop' ipfw. Set firewall_enable to YES in /etc/rc.conf or use 'onestop' instead of 'stop'.
root@vps11031:~ # service ipfw onestop
sysctl: unknown oid 'net.inet.ip.fw.enable'
sysctl: unknown oid 'net.inet6.ip6.fw.enable'


i did it with onestop but still ...

Please close...

my hosting company of web is a big retarded

and didnt allow that ip as i had told them

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.