Unable to create a new connection using Navicat in Ubuntu - mysql

I have installed XAMPP on my ubuntu. Everything are installed in /opt/lampp directory.
When I run localhost/phpmyadmin, it is working fine and I can create database as well.
But when I try to setup using Navicat, it is returning me
2002 - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2 "No such file or directory")
My server is also running sudo /opt/lampp/lampp start
I have used following configuration:
Host: localhost
Port: 3306
User Name: root
Password: my_password
Can anybody please help me here.
Thank You.

Use 127.0.0.1 ip address instead of localhost to connect to MySQL.
Reason:
When using localhost to connect to MySQL, the operating system will use the socket connector.
If you use the 127.0.0.1 ip address, the operating system will use the TCP/IP connector.

Related

Problem with remote connection to MySQL database (Error 1045)

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.

Cannot connect to Database MySQL from workbench

I am try to using MySQL Workbench but its showing error "Cannot connect to database".Neither it taking it localhost or my Endpoint of AWS RDS as DNS in host in workbench.
"I am using Xampp for mysql server running on port number 3306 "
Error :
Cannot connect to DataBase Server
Your connection attemp to failed for user 'root' from host to server at localhost:NULL;
can't open named pipe to host:pipe:MySQL (2)
Please:
1.Check that mysql is running on server localhost.
2.Check that mysql is running on port NULL (note 3306 is the default,but this can be changed)
3.Check the root has rights to connect to localhost from your address .
4.Make sure you are both providing a password if nedded and using the correct password for localhost connecting from the host address you are connecting from.
If you want to test the connection to MySql, Use Heidi (i recommend it). If it didn"t work, check if your DataBase server is running in port 3306 by taping:
netstat -atp tcp | grep -i "listen".
You can also change listenning port in /xampp/mysql/bin/my.ini:
my.ini:
Password = your_password
port = 3306 ---> 3307
socket = "/ xampp / mysql / mysql.sock"``
Looks like you have no port configured. Check your connection settings that you have a port set.

Puphpet MySQL Workbench Connection in Vagrant on Cygwin

I am new to programming, and do not have much idea about ports/forwarding/connection etc.
Installed Vagrant, MySQL Workbench, and Cygwin on Windows 8.1, then
Puphpet on Cygwin and created Virtual Machine, for learning.
But, unable to connect to MySQL on Virtual Machine (MySQL Server is on, on Virtual Machine) from Workbench in Windows.
I did not do any change in vagrantfile or config.yaml.
Tried Out:
Changed to bind-address = 0.0.0.0 in my.conf, but no use.
Commented out # bind-address = 127.0.0.1 in my.conf, again
no use.
Note: (I DELETED id_rsa file when it was not properly doing vagrant up
second time. So, gave full path to id_rsa.ppk, for connecting)
Connection Method: Standard (TCP/IP over SSH)
Parameters:
Hostname: 192.168.56.101:8957
SSH Username: vagrant
SSH Password: vagrant
SSH Key File: c:\cygwin64\home\tomy\puphpet\sutfva\puphpet\files\dot\ssh\id_rsa.ppk
MySQl Hostname: 127.0.0.1
Port: 3306
Username: dbuser
Password: 123
Error message:
IO Error [Errno 10061] No Connection could be made because the target
machine actively refused it. Please refer to logs for details
The answer at Vagrant MySQL Access is not clear to me. How to configure port forwarding?
Can you please guide me in simple words, how I can establish connection? Also, how to disconnect, and any security issue.
Thank you very much Juan Treminio and Brian Morton! Both of them gave valuable tips and inputs for me to come to track! In addition, immense thanks to Juan Treminio for his https://puphpet.com which is a huge help to persons like me.
COMPLETE Connection Details:
Choose
Standard TCP/IP over SSH
Parameters (Mostly default values since I did not change it)
SSH Hostname: 192.168.56.101
SSH Username: vagrant
SSH Password: vagrant
SSH Key File: C:\cygwin64\home\tomy\puphpet\sutfva\puphpet\files\dot\ssh\id_rsa
MySQL Hostname: 127.0.0.1
MySQl Server Port: 3306
Username: root
Password: 123
Note: Remember to note down your connection parameters
Hostname: 192.168.56.101:8957
You shouldn't need the port here, you should probably just need to ender 192.168.56.101
To verify which port SQL Server is listening on, you can ssh into the box and run
netstat -lnutp
This will output a list of the currently open and listening ports on the box. If you do not see SQL Server in the list, then it is not currently running and the service will need to be started.

Connecting to a MySQL Server over WAN

I have setup a MySQL 5.6 Server on an Ubuntu 14.04 Server distribution on Virtualbox, and am trying to connect to it via TCP/IP from the host Linux Mint 17 Desktop OS over the WAN.
Connection through the MySQL client on the VM works fine, but whenever a connection is attempted from the host machine (via mysql-client-5.6 package) an error comes back with one of 2 errors:
INPUT: $ mysql -u client -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
or
INPUT: $ mysql -u client -p protocol=tcp -h 127.0.0.1
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
Server Setup:
Fresh Ubuntu 14.04 Server installation with only mysql-server-5.6 and openssl packages installed from Ubuntu APT repository.
Users created are 'root'#'%' and 'client'#'%', both with full privileges given to them.
Iptables was modified to try and fix the issue (it came completely stripped) and shows: accept tcp connection from mysql and shows:
target: ACCEPT prot: tcp opt: -- source: anywhere destination: anywhere tcp dpt:mysql .
Configuration file "/etc/mysql/my.cnf" was hardly touched, only tried to change bind-address to values 127.0.0.1 , 0.0.0.0 , commented : all unsuccessful. Server and Client socket is set to 3306.
"service mysql status" returns output: "mysql start/running, process 10650"
Checked that tcp port 3306 is being listened to through "netstat -tulpn" command. returns output: PID=tcp6 Local Address=:::3306 Foreign Address=:::* State=LISTEN .
Client Setup:
Installed package mysql-client-5.6 from Ubuntu APT repository
All configurations are preset and untouched.
Would like an affirmation on the following: Was getting the idea that connecting through Unix socket is only possible through the OS hosting the server (internally), while any external OS has to use TCP/IP and so I tried the "protocol=tcp" bit in my 2nd input.
Was searching for a solution for over 2 days now, starting to feel really frustrated. Any useful help would be greatly appreciated!

Trouble Creating a connection in MySQL Workbench

I am using Fedora 18 and recently installed MySQL workbench.
I created a new connection in MySQL workbench, but when trying to open I get the following error:
Cannot Connect to Database Server
Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306:
Can't connect to MySQL server on '127.0.0.1' (111)
Please:
Check that mysql is running on server 127.0.0.1
Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)
Check the root has rights to connect to 127.0.0.1 from your address (mysql rights define what clients can connect to the server and from which machines)
Make sure you are both providing a password if needed and using the correct password for 127.0.0.1 connecting from the host address you're connecting from
Any idea what the issue would be?
Fedora 18 is a Linux Based Operating System and it works on chmod 777. so there should be authentication problem. otherwise server 127.0.0.1 and host name , username same as we keep in windows. you need to set authentication.