setting up MySQL Workbench with MAMP - missing 'mysql.sock' file - mysql

I am having trouble connecting MySQL Workbench to MAMP. I am using version MySQL Workbench version 6.0 and MAMP version 3.0.3.
I have followed the instructions on this link: http://www.rubberneckdesigns.com/mamp/how-to-set-up-mysql-workbench-for-a-mamp-server/comment-page-1/#comment-6539 (this is just basic instructions to setting up MySQL Workbench with MAMP so no need to look through if you are familiar with the set up steps)
It all goes okay until the step were I have to select the Configuration File as:
/Applications/MAMP/tmp/mysql/mysql.sock
This file does not appear to be in this location or anywhere else on my computer.
In the answer to this link: Database connection "Mysql" is missing and mysql.sock is missing, he says he managed to figure out that his mysql.sock file was actually hidden, however I have my Mac set to display hidden files and I can see all my other hidden files, but still no sign of this file. He said after finding it was hidden he went to his database configuration file and added the following:
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock'
Does anyone know what file he is referring to when he says database configuration file? I have tried figuring it out using Google but no luck. I am new to MAMP and new to MySQL Workbench.
This problem with the mysql.sock file, seems to be a problem for a lot of people. If anyone has a better solution than adding the above command to the database configuration file or can shed some light on this problem I would love to hear it.
Thanks

I have not been able to figure out where the mysql.sock file is, Mike Lischke has left a comment saying the socket file is created dynamically when you open a connection, which could be the case, but I do not know much about MySQL and the files so I can not confirm if this is correct, however, I have found the solution to my problem.
The overall problem was that I could not connect MySQLWorkbench to my Local Server (MAMP) as I could not find the mysql.sock file. When I tried to connect I was getting an error message saying it could not find the mysql.sock file.
The solution to my problem was to instead of setting the 'Hostname' in the MySQLWorkbench set up window as 'localhost', which is suggested in the guide I followed, I instead set it to the IP '127.0.0.1'. I then set the 'Connection Method' to 'Standard (TCP/IP)' instead of 'Local Socket/Pipe'. I believe what this is doing is setting it up to connect through the IP rather than the Socket, meaning the mysql.sock file is no long necessary.
This is a very simple solution and in hindsight it makes sense and I probably should have known this from the start, however because I am new to MySQL I didn't. If anyone else is having a similar problem connecting, I hope this helps.

Related

MySQL said: Documentation #2054 - The server requested authentication method unknown to the client

There are similar question in the thread but here I am obliged to mention this issue because being a newbie learner I couldn't figure out and resolve this problem. Sorry for my long English, I hope you care to help me.
By the way, I have the XAMPP Control Panel installed on my windows already and I had worked on to create few databases in the localhost/phpmyadmin (browser). Today, I had downloaded and installed MySQL-installer-community from this Link. I followed all the procedures to install it and configured it correctly.(The default port number was 33060 and I don't change that while installing the MySQL Installer).
But later by some reason I had to approach to my previous XAMPP Control Panel and tried to start APACHE and MySQL. APACHE was started but MySQL cannot be started and got terminated automatically. Later I found that MySQL in XAMPP Panel is running on same ports as I had not changed the port number while configuring the MySQL installer. So, I changed the default MySQL port number i.e. 3306 on XAMPP Control Panel to 3307 by making the changes in my.ini file as shown in the embedded image:
Changes on my.ini file
Later, while I restart the XAMPP Control Panel, MySQL starts without delivering any errors SEE HERE but still the Access is denied on the browser. For image, see this:
Access denied in the browser
However, through shell alongside, I can fetch the databases even though the access is denied in browser.
Accessing Database via Shell
Thus, I am seeking for the help on why can't I access the databases via localhost/phpmyadmin on the browser? Please guide me thoroughly!!
I found the solution on my own:
For this we have to go to the drive where the XAMPP is installed (for me it's C:\xampp). Then, we have to look for the folder phpmyadmin and click on that.
Inside the phpmyadmin, we have to look for the file config.inc and open with notepad or any other text editor. Look for the line $cfg['Servers'][$i]['host'] = '127.0.0.1:3306'; and change it to $cfg['Servers'][$i]['host'] = '127.0.0.1:3307';
This works for me.

OSX MySql terminal parameters

So I am going crazy with this. I have MAMP installed and it's MySQL is working fine. I now installed MySQL 5.7.19 from the official dmg from their site and installed.
From the pref panel I am not getting status updates and as such I cannot stop it even though it is running. Trivial though as I can launctl unload it.
However, the big issue I am facing is that although the server starts correctly (from pref panel) and I can see the process running and the respective /tmp/mysql.sock file when I try to run mysql in terminal (or any other mysql command) I get an error stating it cant find the sock file and it pipes out the Applications/MAMP path.
I looked everywhere for a my.cnf that might be setting this and there are none (apart from the one used by MAMP). No environment variables set to override it, nothing. In fact, there are no other my.cnf files but for some reason it still thinks it should be using /Applications/MAMP path.
my_print_defaults client confirms this as it pipes out
--socket=/Applications/MAMP/tmp/mysql/mysql.sock
but I have absolutely no idea where and how this is being set and I need to be able to run on this instance terminal commands. Driving me crazy for hours now.
No files at
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf
No environment variable MYSQL_UNIX_PORT as described here: https://dev.mysql.com/doc/refman/5.7/en/problems-with-mysql-sock.html
So how the heck is it getting this value?
Also checked at DATA_DIR and BASE_DIR, no my.cnf there either.
Obviously Ive done which mysql to confirm I am calling the correct binary.
Any help much appreciated!
UPDATE Running my_print_defaults client --verbose --no-defaults pipes the same exact output, so I am guessing it is somehow set elsewhere. Where can this variable be set otherwise?
Ok so I found the answer after all and sharing it for anyone having the same issue.
In essence, the --socket parameter is added via the ~/.mylogin.cnf file!
I am not sure if I ever added it there but I am pretty sure it wasn't me, so I am guessing MAMP did it.
This is an encrypted file so you can't edit it directly by you can change it via mysql_config_editor:
mysql_config_editor remove --socket
And problem solved!

Problems with mysql config - want to understand

i know that there are many questions which are connected with my question, but nothing helps me to come to my goal.
I'm on mac osx 10.10.4
in the past i had MAMMP installed on my mac. Later i deleted it to configure my local hosts by my own. In the meantime i use vagrant for this. But i want to understand how the local mysql config works.
My problem:
If i type "mysql -uroot" i get this error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)
The /Applications/MAMMP/.. folder are deleted and not there. So i think there must be a config file where this is inserted. But i cant find this file. Not in /etc/my.cnf and not in /usr/local/mysql/support-files/... nowhere...
Could anyone give me hints where my config for that is destroyed and how i can reapair it?
Would be great to hear from you guys. Thanks

connection refused mysql node.js

I've tried everything under the sun to fix this problem, nothing works!
I'm trying to connect to mysql using node.js.
I've tried both normal connections and pool connections, but I keep getting the following error:
"connect ECONNREFUSED"
I'm working on a Windows 7.
There are many similar questions to this on Stack Overflow, and everyone mentions the mysql configuration file (and commenting out "skip-networking"), however, I can't find where the file is (the mysql module was installed under node_modules).
I've tried looking for my.ini and my.cnf, there don't seem to be on my machine either.
Is there a way to try to log in to mysql via the command line?
It seems like there isn't since the command line doesn't recognize the command "mysql".
I'd post the code that I've been using but that wouldn't help, since I've been using dozens of different alterations, and all fail.
Thanks in advance, I appreciate the help!
Thanks to Салман, I realized that I need to install the actual MySQL server as well.

MySQL Workbench "fetching..." -- cannot browse DB

I've been having a lot of issues lately, basically since the last time I upgraded XAMPP for OSX (v1.7.3) and/or my MySQL GUI tools. Using MySQL Workbench (v5.2.44), I can connect to the DB running in XAMPP just fine, but trying to browse any database, under tables/views/etc it only shows "Fetching..." and never shows anything else. I can actually query tables, which is interesting, but I can't actually manage the databases in any meaningful way.
Googling, others reported having luck running mysql_upgrade on the command line, which ran fine but did not fix my issue.
The following command worked for me on windows:
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysql_upgrade.exe -u root -p --force
If the root password is not set, you might need to do this before you run the command above:
mysql> SET PASSWORD FOR 'root'#'localhost' = PASSWORD('something');
The link above to mysql_upgrade did not solve my problem directly, but it did lead me to examine my mysql error file, which ultimately led me to the solution. I noticed several lines like this in the error file (located at [xampp root]/var/mysql/[dbname].err):
/Applications/XAMPP/xamppfiles/sbin/mysqld: Can't create/write to file
'/var/folders/y2/37h93r_931sdfpcr7vnc83380000gn/T/ibigNFFi' (Errcode: 13)
That led me to this page in the MySQL docs which states that you should explicitly set the temp folder for MySQL. I double-checked my config file ([xampp root]/etc/my.cnf) and saw this, which looked fine:
[mysqld]
tmpdir = /Applications/XAMPP/xamppfiles/temp/
However, looking back at the error log, I also noticed this:
Warning: World-writable config file '/Applications/XAMPP/xamppfiles/etc/my.cnf' is ignored
Duh. The config file was getting ignored, so the configured temp folder was not getting used (I have no clue why the file was world-writeable...). I edited permissions on the my.cnf file which was 777 and simply removed the "Everyone|write" permission (now 775 / -rwxrwxr-x), reloaded everything, and now everything works.
Not a very intuitive symptom for the ultimate fix, so hopefully this helps someone else.
If you have MAMP instead of XAMP the solution above won't work for you.
Open MAMP then on the top menu go to Tools->Upgrade MySQL databases.
Now open Mysql Workbench and it should list all your tables correctly
If you are using linux distro the run following command:
mysql_upgrade -u root -p
I set Authenticated Users with all privileges to the var/folders/y2/
For me work fine ;)
Before the process I removed authenticated users privileges.
Close and reopen Workbench. it worked for me.
Stop server.
close workbench window
start server
open workbench window
worked for me .. windows 64bit
I had that error with MySQL 8, win10. I've noticed that this line Where the error was
Was leading to another directory trying to find the my.ini file. Looked for it, found it in that directory, changed it. Opened Workbench, clik on every item that was in gray, and turned it into black and that's it!! Ok now!!