Good evening all, i have set up an azure server with ubuntu server and have installed MySQL with some python code I need to run , I have turned off the firewall on Ubuntu and setup port forward on azure and i still can not connect to MySQL from my pc using workbench, I installed PHPMyAdmin as well and I was not able to connect to that either, I am not sure what else I can try, I have started setting up a new server on a local pc but I would it on the cloud
I created a Linux (ubuntu 18.04) VM ,set up a mysql on it and access it on my local successfully. This is my steps below :
1.Enable 3306 port on Azure portal :
2.Connect to Azure VM , and run command below to install mysql :
sudo -i
apt install mysql-server
3.After your mysql is installed , modify “bind-address” directive in /etc/mysql/mysql.conf.d/mysqld.cnf , modify 127.0.0.1 to 0.0.0.0 to make sure your mysql server will listening on all your VM's ips :
vim /etc/mysql/mysql.conf.d/mysqld.cnf
save your modify and restart your mysql server :
systemctl restart mysql
This time , can ping 3306 port of my vm successfully :
If your mysql server is running on your VM successfully , but you can not ping it,if the error info is timeout , pls check your firewall settings , if the error info is remote server refused your request , this means there is no service listening on 3306 port.
4.Create a user on mysql so that we can use this account connect to mysql from local:
CREATE USER 'stan'#'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'stan'#'%' WITH GRANT OPTION;
Well , try to connect to mysql from local using navicat :
Connect to mysql on Azure Linux VM from local successfully :
Hope it helps .
Related
I installed MySQL Server 8.0 on Windows Server 2019, during installation I created user 'superna' # ' %' with DBAdmin rights. When connecting from a local machine, there are no problems (mysql -u superna -p), but when trying to connect from a remote machine (mysql -h 10.165.1.20 -u superna -p), error 1045 is returned.
I checked the availability of port 3306 using nmap, port is open.
When installing mysql server on Windows 10, such problems are not observed, the connection from the remote machine works correctly. Can you tell me what point in the settings I might be missing?
Can you confirm if your my.cnf file have this line? If it hasn't, add it and restart mysql.
bind-address = 0.0.0.0
Problem solved. The server was configured to NAT port 3306 to another machine on the network.
I have Installed MySql 8.0 Version in a windows
server and able to connect via WorkBench/MySql shell locally.
I would like to access MySql from a remote windows server.
Here are the things I have tried.
1) Created root#% user and Grant full access to the new user.
2) Created a new user as test#'remoteserveripaddress' and Grant full access to the user.
3) Opened port 3306 on Both Remote and MySql server.
4) Added "bind_address=*" in my.ini file and restarted the MySQL80 Service.
I am running out of options.
Error: I am getting below error
Failed to connect MySql at UserName#hostipaddress:3306
SSL connection error: error:00000000:lib(0):func(0):reason(0)
No matter how many different ways I try.
Not sure what am I doing wrong ??
Try to execute below command in your terminal :
mysql -h server -P 3306 -u root -p
If you successfully connect to your database, the same thing has to happen with Mysql Workbench.
If you are unable to connect then I think 3306 port is acquired by another process.
Find which process running on 3306 port. If required, give admin privileges using sudo.
netstat -lnp | grep 3306
Kill/stop that process and restart your MySQL server. You are good to go.
Execute the below command to find my.cnf file.
mysql --help | grep cnf
You can change MySQL port to any available port in your system. But after that, make sure you restart MySQL server.
I am having mysql server in my premise which is running on windows. Now I want connect this mysql database from an ubuntu ec2 instance but it is giving can't connect to mysql server at my IP (110 connection error)
Can some one help me to connect from ubuntu to my local window.
For your info: I am not able even ping from ubuntu instance to my local IP
Add MySQL IP on EC2 security group and port will be 3306
then
Use the below command to install the MySQL client on your ec2 instance.
sudo apt install mysql-* -y
after installation of mysql on ubuntu try to connect with the MYSQL using below command.
mysql -h hostname -u username -p password -P Portno
Hope so this will help you.
In able to connect to an MySQL server exists in EC2 instance you should provide some main parameters like:
Connection Method: Standard TCP/IP over SSH
SSH Hostname: the public ipv4 address of your EC2 Ubuntu instance
SSH Username: ubuntu
SSH Key File: your AWS credentials (key pair) file
And enable rules for connecting to MySQL server in your SecurityGroup:
(TCP on port 3306).
and you should be able to connect smoothly.
And for more information refer to this link:
reference
Need help!
i've set remote permissions for mysql (port 3306 both inbound and outbound ) from my ec2 instnce security groups settings,
set wildcard privileges (%) for the user in mysql database,
set bind-address=0.0.0.0
in my /etc/mysql/my.cnf file
still cant connect to mysql from my remote host.
mysql version 5.7
ubuntu 16.04 server.
For mysql version 5.7 and above use /etc/mysql/mysql.conf.d/mysqld.cnf
For mysql version 5.6 and below only use /etc/mysql/my.cnf
if there's a firewall installed, you should open the port on the firewall and restart
ufw allow 3306/tcp
sudo service ufw restart
It's not secure way to connect mysql remotely. It it's more secure if can connect to MySQL through ssh tunnel.
Please follow the steps in the link below to get remote access to MySQL -
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
I have a MySQLdb running on my Ubuntu Laptop. I have created a database.
I need to access this database on my laptop from my Raspberry pi.
I have installed PyMySQL on my raspberry pi. I have also configured the mysqld.conf file in my laptop and commented out the bind address line.
But eherytime i use the following command on my RPi
conn = pymysql.connect(host='192.168.10.7', port='3306', user='root', passwd='password', db='temps')
192.168.10.7 is my laptop ip address. This IP address can be pinged from my RPi.
but i get error
pymysql.err.InternalError: (1130, "Host '192.168.10.7' is not allowed to connect to this MSQL server")
Do I need to make anymore changes in the configuration? If yes, can you please guide me?
By default MySQL Server on Ubuntu run on the local interface, This means remote access to the MySQL Server is not Allowed. To enable remote connections to the MySQL Server you need to change value of the bind-address in the MySQL Configuration File.
Open the /etc/mysql/mysql.conf.d/mysqld.cnf file (/etc/mysql/my.cnf in Ubuntu 14.04 and earlier versions).
Under the [mysqld] Locate the Line,
bind-address = 127.0.0.1
And change it to,
bind-address = 0.0.0.0
Then, Restart the Ubuntu MysQL Server.
systemctl restart mysql.service
Now Ubuntu Server will allow remote access to the MySQL Server, But still you need to configure MySQL users to allow access from any host.
For example, when you create a MySQL user, you should allow access from any host.
CREATE USER 'username'#'%' IDENTIFIED BY 'password';