Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open Terminal not working even after exporting DBngin to PATH #38

Closed
benmaloway opened this issue Nov 21, 2019 · 15 comments
Closed

Open Terminal not working even after exporting DBngin to PATH #38

benmaloway opened this issue Nov 21, 2019 · 15 comments

Comments

@benmaloway
Copy link

Please fill out the detail below, it helps me investigate the bug:

  1. Driver (Ex: PostgreSQL 10.0):
    MySQL 5.7
  2. DBngin build number:
    version 1.1(20)
  3. macOS version:
    10.14.6
  4. The steps to reproduce this issue:

I have followed the instructions that appear in a dialog when you do 'command T' or press the console button "Copy this content into your ~/.bash_profile". I refreshed the bash profile and it appears to be correct. When I do an 'echo $PATH' in my terminal I have:
/Users/Shared/DBngin/mysql/5.7.23/bin:/Users//.nvm/versions/node/v13.0.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

You can see the default path, along with nvm along with the DBngin path.

But when I go back into DBngin, it still gives me the same dialog window with the instructions to "Copy this content...etc", and no terminal.

If I simply open the terminal and do a 'mysql -u root' with the DBngin instance running I get:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

So first DBngin does not want to open the terminal window from within the application and second the mysql symlink seems to not work anyway from with the cli.

I do like this software and want to avoid having to use heavy stuff like Homebrew, Vagrant or Docker, but I also want to be able to access stuff I would normally when developing for PHP frameworks like Drupal or Symfony. Any advice would be welcome!

@hopewise
Copy link

I have the same issue:
it asks to add:

# DBngin exports
export PATH=/Users/Shared/DBngin/mysql/5.7.23/bin:$PATH

how ever, its already adde and sourced.

@QinyuHu
Copy link

QinyuHu commented Feb 4, 2020

Having the same issue. There are no other instructions on what to do with it.

@kpysanyi
Copy link

Yes, is there any solution to fix this issue?
I am also getting Can't connect to local MySQL server through socket '/tmp/mysql.sock' as an error when i try to connect mysql...

@huyphams
Copy link
Contributor

You can connect with port @kpysanyi if you want to connect with socket, you can lookup the correct socket (with port) in /tmp
I've fixed this issue in the upcoming release.

@zisiszikos
Copy link

Is this really working?

I follow those steps:

  1. Strarting MySQL 5.7.23 : 3306 from DBngin interface
  2. Open terminal and run: export PATH=/Users/Shared/DBngin/mysql/5.7.23/bin:$PATH
  3. which mysql returns correctly /Users/Shared/DBngin/mysql/5.7.23/bin/mysql
  4. running ps -ax | grep mysql | grep -v grep finds the following process:
    /Users/Shared/DBngin/mysql/5.7.23/bin/mysqld --user=_mysql --port=3306 --socket=/tmp/mysql_3306.sock --basedir=/Users/Shared/DBngin/mysql/5.7.23
  5. running mysql command I get the following:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    which is expected because it is trying to find the /tmp/mysql.sock but the service is showing that the socket is /tmp/mysql_3306.sock

Any thoughts about this?

@huyphams
Copy link
Contributor

huyphams commented May 7, 2020

Hi @zisiszikos you can connect using the full path comand:
mysql --socket /tmp/mysql_3306.sock -uroot
DBngin supports multiple ports so it will cause conflict of socket if we use the same socket path for all running services.
Also on the new DBngin version, you don't need to export binary, just click the arrow button and it will open terminal.

@zisiszikos
Copy link

zisiszikos commented May 7, 2020

Thanks! It works with the socket parameter.

But there is another thing, that I don't know if it is my terminal problem or DBngin problem actually.
When I click the arrow button to open the terminal, the following command is written at the terminal:

export PATH=export PATH=/Users/Shared/DBngin/mysql/5.7.23/bin:$PATH:$PATH

It works, but as you can see the command is incorrectly written. Just confirm please if this a global problem or it is just my terminal.

And of course it would be very nice if there was an option to choose which terminal is going to open. 😄

Thanks.

@huyphams
Copy link
Contributor

huyphams commented May 7, 2020

Ah yeah, I've fixed it 😄

@maskedjellybean
Copy link

I'm still experiencing this issue. Running mysql --socket /tmp/mysql_3306.sock -uroot does work, but I would really like to be able to run mysql -uroot. Does DBngin require connecting via socket?

@huyphams
Copy link
Contributor

huyphams commented Aug 12, 2020

We can create many MySQL versions in DBngin, so it's not possible to use the same socket path for all versions. The current solution is add the port suffix to the local socket.

@huyphams
Copy link
Contributor

huyphams commented Aug 12, 2020

Does DBngin require connecting via socket?

DBngin supports both socket and port, however, mysql -uroot use socket by default that's why you can't connect with the default path.

@koriym
Copy link

koriym commented Nov 22, 2020

@maskedjellybean

Adding function to ~/.bashrc works.

function mysqls() {
  command mysql --socket /tmp/mysql_$1.sock -uroot
}

mysqls 3036 connects port 3306 DBngin mysql server.

@debiprasad
Copy link

I'm still experiencing this issue. Running mysql --socket /tmp/mysql_3306.sock -uroot does work, but I would really like to be able to run mysql -uroot. Does DBngin require connecting via socket?

I use oh-my-zsh and I added an alias to make it easy.

@izshreyansh
Copy link

I have the same issue: it asks to add:

# DBngin exports
export PATH=/Users/Shared/DBngin/mysql/5.7.23/bin:$PATH

how ever, its already adde and sourced.

This worked, Thank you.

@SiddharthPant
Copy link

SiddharthPant commented Mar 24, 2024

Just stating for everyone's quick reference that to avoid defining aliases you can instead export an environment variable. Just include line export MYSQL_UNIX_PORT=/tmp/mysql_3306.sock at the end of your ~/.zshrc. Now you can connect to mysql using mysql -uroot as usual.
Here are more env vars you can use from mysql docs: https://dev.mysql.com/doc/refman/8.0/en/environment-variables.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests