I'm working on laravel project (for the first time), And I want to use MySQL workbench for database.
But when I set my settings
host: 127.0.0.1
port: 33060
user: homestead
pass: secret
I got this error:
Lost connection to MySQL server at 'reading initial communication packet, system error: 0
What can I do?
Note : I'm using windows 10
UPDATE #1 : Mysql workbench worked with these settings :
But I got an error when i tried to make (php artisan migrate)
This is a screen shot from my .env file:
I Solved the problem by doing vagrant up and using the port 3306
You are using the wrong port. 33060 is the default port for the new X protocol. MySQL Workbench however only uses the classic protocol atm.
Related
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.
I've been using the official MySQL NPM package found here: https://www.npmjs.com/package/#mysql/xdevapi.
However, I can't seem to make a connection to the server. Here's the current error message I get:
Error: The server connection is not using the X Protocol.
Make sure you are connecting to the correct port and using a MySQL 5.7.12 (or higher) server intance.
Here is the code that generates that issue:
const db = mysqlx.getSession('root#localhost:33060/schemaname').then(session => {
console.log('SESSION STARTED!!');
});
This is just a test database without a password so I don't think the password is the issue. Also, I've made sure I'm using the right port and the MySQL version is 8.x.x so I don't think that is the issue. I created a database using the app Dbngin and I verified I could connect to the database by running the following command in my terminal: mysql -u root -h 127.0.0.1 --port=33060 -p which worked. I'm also running this on my Mac.
Update:
I've also tried passing a config object without much luck:
const config = {
user: 'root',
password: '',
host: 'localhost',
port: 33060,
schema: 'schemaname'
};
const db = mysqlx.getSession(config).then(session => {
console.log('SESSION STARTED!!');
});
Unfortunately, this code produces the same error above.
I tried it out myself and got the same error because you are using the wrong port. It could be you changed the default port, but the default port is: 3306 and not 33060 although I have to use port 33060 while my port is 3306.
X-protocal requires you to multiply your port by 10 I see here: https://dev.mysql.com/doc/mysql-port-reference/en/mysql-ports-reference-tables.html. So if your original port is 33060 I guess it should be 330600.
You could try this command SHOW VARIABLES LIKE 'mysqlx_port';
I'm having trouble connecting to my database through mysql workbench even though I can do it through a console. It doesn't seem like I'm even getting past ssh because this is my error
Here are my connection settings:
Connection Method: Standard TCP/IP over SSH
SSH Hostname: DropletIP:22
SSH Username: forge
SSH Key File: C:\Users\username\.ssh\id_rsa
MySQL Hostname: 127.0.0.1
MySQL Server Port: 3306
Username: forge
The workbench is version 8 and the mysql version on the droplet is version 8.
I've tried switch all kinds of stuff around like removing the port on the ssh hostname, trying the public ssh key instead of the private, and changing the mysql hostname to the DropletIP. None of these worked.
Not really sure why this is happening. I appreciate any help.
you should use the server IP address as your MySQL HOSTNAME
I am trying to create connection to mysql using Navicat but I am getting this error.
I am using following settings
Host/Ip Address: localhost
Port: 3306
UserName: root
Password:
You can Whether it is right by checking user&password
Try changing localhost to 127.0.0.1
Actually,I think only you can sign in by Mysql client then the same in Navicat work.
New to connecting to databases and have no clue to where to begin to troubleshoot -
I am currently using HeidiSQL to connect to an external Mysql Database Server hosted on the Amazon Web Service - EC2.
I am able to access the database using HeidiSQL with the settings:
MySQL (SSH tunnel)
Hostname/ip: 127.0.0.1
user: (user)
password: (pw)
port 3306
in SSH tunnel tab:
plink.exe location is set to putty.exe
sshhost + port: (my host ip) port 22
private key file: (is set)
local port: 3307
Using this configuration I AM able to log into my database.
My problem is when I am trying to do it using my own putty commands using the port forwarding:
In Putty:
I set SSH>tunnels - source port: 3307, destination (my host ip):3306
Local and Auto.
I connect using my passwords and hostip
Back to HeidiSQL, I put my settings to:
MYSL (TCP/IP)
hostname: localhost
user: (user)
password(pw)
port 3307
and try to connect. I get the following error:
SL ERROR (2013): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
From what I have read, this means my ssh tunnel is working but something else is wrong. I am now at a loss on why this doesn't work. Am i not setting something else up properly? Firewalling myself? My ultimate goal is to hook up another application to communicate with the database using ODBC orJDBC using the same port forwarding idea. Are there logs to check somewhere?
You must set
AllowTcpForwarding yes
PermitTunnel yes
in /etc/ssh/sshd_config
It seem's like your're trying to do this:
http://realprogrammers.com/how_to/set_up_an_ssh_tunnel_with_putty.html
It should work. I assume the ssh server and mysql server are running on the remote machine.
In Putty: I set SSH>tunnels - source port: 3307, destination (my host ip):3306 Local and Auto. I connect using my passwords and hostip
It should be: set SSH>tunnels - source port: 3307, destination 127.0.0.1:3306 Local and Auto.
heidisql: MYSL (TCP/IP) hostname: localhost user: (user) password(pw) port 3307
Notice that if you have a MySQL service running on your local machine, on the port your trying to listen (3307 ) you'll get a 2013 error, even if the local service is down! In that case, use any arbitrary unused port.
Also, if the remote mysql server has the user table (mysql database) restricted to certain hosts this won't work. Unless you find out how the server recognize himself (computer name) and add him on the user table or simply you use the '%' wildcard.
Follow below steps it solved my issue while connecting to Live server:
Find your IP (Google - what is my ip).
Go to C-Panel of your Live Server.
Go to Remote MySQL in C-Panel.
Add IP address that you got from Step 1 and save it.
Now try to connect through Heidi SQL.
Please let me know if it helped.