i'm hosting some smaller sites/gameservers on a windows server 2008 R2, and now i can see in my connection log that the database is used more than just local hosted stuff, so i want to limit my mysql to localhost only, and i know by doing that i will not be able to use my "Mysql Control Center" but that is why Xammp is here, there have been "PhpMyAdmin" on it from day one. But how do i make the settings so it is only localhost? and my www.mysqlhostsite.com/phpmyadmin.
Things i got:
Windows server 2008 R2
Mysql
Phpmyadmin
xampp
You can limit connections from a specific address (e.g. localhost) with the bind-address option. Configure this in your my.ini file:
[mysqld]
bind-address = localhost
Alternatively, you can force MySQL to use named pipes (a local-only method for connecting):
[mysqld]
bind-address = localhost
skip-networking
enable-named-pipe
Of course, restart the MySQL Service after editing my.ini.
Related
I am trying to install phpMyAdmin on a machine running ubuntu, for reasons of compatibility I have am running a backdated binary version of MySQL (5.5.54). It is essentially running okay, I can access databases from php clients using localhost.
When I try to use the auto configure script included with phpMyAdmin, I get the following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket d '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
Effectively there is no folder at the location /var/run/mysqld. In file 'my.cnf' the socket is set as socket = /tmp/mysql.sock I have not yet found how to alter this default, it would seem that this is a possible mismatch, there is also a second file, added on installing phpMyAdmin called my.cnf.server.
Should I look to change the socket, or, perhaps configure phpMyAdmin manually?
I would appreciate some help.
This post seems related:
Help to change mysql.sock
Though I was wondering if it is possible to change the socket that phpMyAdmin is looking for. Was the default changed in later versions of mysql; Currently running 5.5.54 for compatibility reasons.
configure PMA to use the correct socket. in config.inc.php replace
$cfg['Servers'][$i]['host'] = 'localhost';
with
$cfg['Servers'][$i]['socket'] = '/tmp/mysql.sock';
I was able to get around this by switching phpMyAdmin from socket connection to TCP connection:
vi /etc/phpmyadmin/config.inc.php and enter the IPAddress instead of localhost
I also had to change the dbserver and dbport in vi /etc/phpmyadmin/config-db.php
I found out that PHP and PhpMyAdmin actually do get their socket values from /etc/my.cnf just that you need to do a service php-fpm restart before mysqli.default_socket is reflected in phpinfo() and phpmyadmin.
in /etc/my.cnf
Careful about the datadir value, in my example I specified these to completely move MySQL directory.
[mysqld]
datadir=/SSD-2/mysql
socket=/SSD-2/mysql/mysql.sock
mysqlx_socket=/SSD-2/mysql/mysqlx.sock
Then important:
service php-fpm restart
So in this case, it was no need to edit /etc/php.ini and /etc/phpMyAdmin/config.inc.php anymore .
I deploy a mysql service on my company remote develop CentOS machine, I'm sure the service is turn on, and it can be access from an other reomte linux machine.
However, I can't connect it from my own Windows PC. I tried mysql workbench client and HeidiSQL client, both failed. I can ping through the remote IP address. I have tried anything I can found on google. Like
add bind-address = 127.0.0.1 to cnf file, and comment out the skip-networking.
I also tried the answer on another question Can't connect to remote server using MySQL Workbench on mac, which allow all machine can access to the service.
But my PC still can't connect to it, which report code 10060 error. So what should I do?
That bind-address = 127.0.0.1 config option means that your mysql server only accepts connections from the localhost, which is your actual CentOS machine. Make sure to set bind-address = 0.0.0.0.
Also, make sure that:
you have connectivity from your windows machine to the CentOS one
no firewall blocks the external connections to the local mysql port
Regarding potential security concerns from opening your mysql instance to the whole internet - first make it work, then make it better
I had the same issue here man,and i discovered that we need to create a user that isnt the root user. I my case, i don't know why yet, the issue was that.
The solution
Steps:
1 - Check the firewall (create a rule for port 3306 or disable it).
2 - Comment the line # bind-address=0.0.0.0 at [mysqld] config optin in C:\ProgramData\MySQL\MySQL Server 5.7\my.ini
3 - Create the user to remote access:
mysql> CREATE USER 'net'#'%' IDENTIFIED BY '123';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'net'#'%' WITH GRANT OPTION;
In my case, solved.
I have installed mysqlserver 5.7 and after that I can not run wampserver it's orange icon never turn to green. any body please help.
WAMPServer also has a MySQL Server installed as part of it.
By default MySQL Server talks with the outside world using a TCP port (3306) and only one app can be using a TCP port at any one time.
So basically you have 2 people both trying to use the same phone line, which is not possible.
If you have WAMPServer installed you have no need to install another MySQL Server instance, so I suggest you uninstall the independant MySQ Server that you have installed. It is quite possible for one MySQL Server to run 100's of seperate databases, so if you thought you needed ONE MYSQL PER DATABASE that is not the case.
You can edit the configurations and make them run on different ports. For me I installed MySQL server 5.7 first and after I tried to install wamp, but it couldn't run. Go to C:\wamp\bin\mysql\mysql5.6.17 and edit the following lines in the file my.ini
[client]
#password= your_password
port= 3308
[wampmysqld]
port= 3308
[mysqld]
port=3308
I also edited the file:mysql_config.pl in C:\wamp\bin\mysql\mysql5.6.17\bin
$port = '3308';
save changes and restart WAMP, it should launch normally.
I have deployed one django application on live IP adress Backend is Mysql running on the same IP.
There is pythoncard(GUI) application installed on some another DNS/Gateway.
I am getting 2003 can't connect mysql server on ...242* while executing.
Grant all and everything done but it is raising the same error. How do I connect to that host through internet or static IP.
HOw to resolve it? Mysql level or application level
Thank you
This is my.conf
[client]
port=3306
[mysql]
default-character-set=latin1
[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
bind-address = 110.243.143.*** # SERVER IPADDRESS
# skip-networking
#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files (x86)/MySQL/MySQL Server 5.5/"
Make sure MySQL is listening on your public IP. You can set this in my.cnf. The property you are looking for is bind-address.
Next, make sure your user is authorized to connect from a remote IP. You can adjust the permissions using the GRANT statement.
I am setting up MySQL on an Ubuntu 11.04 Server and had a problem connecting remotely. I changed the bind-address property in the my.cnf file to be the IP address of the server instead of 127.0.0.1 loopback. Now remote connections work fine, but I can't connect to it locally with my local web app. How can I accomplish this? Thanks!
You can comment out or remove the bind-address from your my.cnf if you want mysql to listen on all IP addresses. Restart.