Using XAMPP Install of MySQL with Netbeans 6.8/MySQL Workbench - mysql

All,
For all of this I am using Mac OSX Snow Leopard.
I have happily used XAMPP to develop PHP backed sites in the past with no problems(as you'd expect for such a simple to set up package). I am now trying to set up this MySQL install in Netbeans 6.8 (for now just trying to get a sample database backed webapp to run). My issue is that even though MySQL has been started I cannot connect to it at 127.0.0.1 on port 3306 (which it is set up to use).
I have read that the issue is that XAMPP holds MySQl.sock in /Applications/XAMPP/xamppfiles/... whereas MySQL Workbench and Netbeans expects to find it in /tmp/MySQL.sock. Is this correct? I've tried to set up a symbolic link from /tmp to the xmapp directory but this doesn't appear to have changed anything.
Is there anything else I can try/anything that I am missing?

I upgraded from an older version of XAMPP to 1.7.3 and encountered a the same problem, I got MySQL Workbench to connect if I edited the my.ini file and:
changed the socket parameter to:
socket = "TCP/IP"
made mysql bind to an IP address or all IP as in the case below:
enable-named-pipe
bind-address=0.0.0.0
This requires that you disable named-pipe (as shown above)

I could not get this to work. So in case anyone else is reading this and wondering what happened... I installed a non XAMPP instance of the MySQL database and am using that now instead. Less than ideal but it works.

Related

Linking MAMP on Mac to a different instance of MySQL and phpMyAdmin

I am using macOS Sierra 10.12.2, MAMP 3.0.7.3.
I have been using MAMP with the MySQL it comes with for a while but I need to run something (Magento 2) that requires a higher version of MySQL than the version MAMP comes with, and I don't want to upgrade that instance of MySQL that comes with MAMP. So I am trying to install a different instance of MySQL for use on this project. I still want to use MAMP's Apache server with PHP to run the project though. I also still want to be able to switch back to the other instance of MySQL.
I am essentially trying to follow this tutorial, but I also want to install phpMyAdmin: http://www.human-element.com/installing-magento2-on-mac-for-local-development/
I have installed MySQL 5.6.35 to /usr/local/mysql/bin
The MAMP MySQL is at /Applications/MAMP/Library/bin/mysql
/Applications/MAMP/Library/bin/mysql --version is 5.5.38
mysql --version is 5.6.35
It seems to be installed correctly but I want to use phpMyAdmin for it, which is where I am having trouble. I downloaded phpMyAdmin 4.6.6 and installed it to /Applications/MAMP/htdocs/phpMyAdmin-4.6.6 (as I still need MAMP to run it). But it seems to be linking with the MAMP instance of MySQL and not the new instance of MySQL. I can only log in with credentials for the MAMP MySQL users and I see all my MAMP databases.
If I go to localhost/phpMyAdmin-4.6.6/setup I think the setup must be wrong but I'm not sure how to specify the other MySQL instance:
I tried changing the server socket path to /tmp/mysql.sock too - this had no noticeable effect.
I also have some symbolic links set up, although I admit I don't really understand what this is for...
cd /var/mysql/
# This one was set up before when I was just using MAMP:
mysql.sock -> /Applications/MAMP/tmp/mysql/mysql.sock
# This is the equivalent I set up (removing above one) for the new instance, but not sure if correct:
mysql.sock -> /tmp/mysql.sock
I've tried switching between both but it doesn't seem to have any effect on phpMyAdmin.
Can someone explain how I link the new version of phpMyAdmin with the new instance of MySQL?
Since you're essentially trying to run two MySQL instances at the same time, you have to make sure they're not using the same socket and TCP/IP port. These things are configured in the MySQL configuration file. I suggest not messing with the MAMP installed version, so edit the one you installed and make sure the port and socket path are different. Also make sure your data directory is different; you can't use the same datadir for two MySQL instances at the same time, and certainly not changing between versions, either. Once you have that sorted out, you can configure phpMyAdmin to connect to them both (you can define more than one server, based on port, hostname, and/or socket).

MySQL Workbench incompatible/nonstandard server

I am new to using MySQL and I needed to download it for school, however, I keep getting this error message (picture below). I am using xampp and connecting using the username root. the port also matches what it is telling me. It will let me proceed but a lot of the features are missing. Any help at all would be appreciated.
Incompatible/nonstandard server version or connection protocol
detected (10.0.10).
A connection to this database can be established but some MySQL
Workbench features may not work properly since the database is not
fully compatible with the supported versions of MySQL.
MySQL Workbench is developed and tested for MySQL Server versions 5.1,
5.5, 5.6 and 5.7
As I can see, You are using latest XAMPP.
All you need to do is, after opening MySQL Workbench, and instead of setting up a new connection, Press CTRL+R or click on DATABASE tab in the top menu. Select Reverse Engineer and provide necessary information. You are good to go now.
The MySql workbench wont crash or show any compatibility issue now.
The current version of XAMPP uses MariaDB instead of MySQL.
Because MySQL Workbench is designed to work with MySQL and not with the very similar drop in replacement MariaDB, you are gonna have problems ...
So, if you want to use MySQL Workbench with XAMPP then a solution would be to try installing the last version of XAMPP that uses MySQL. That version is probably 1.8.3 from (August of 2014?). You can download it here:
XAMPP Sourceforge old versions
If you are using the latest XAMPP that uses MariaDB, in that case in your MySQL Workbench don't use 'Connect to Database' instead use 'Reverse Engineer' and provide the necessary credentials. That's all, No hassle.
I encounter the same message followed by a crash of MySQL Workbench, with version 6.3.7 (build 1199).
I didn't find a solution, but here is a work-around:
Once you press the button Continue anyway, just open a database use toto, and then wait a bit (a minute is enough in my case), and then you can call a query without a crash. I found this trick here.
I experimented the same with WAMP 3.2.0.
MariaDB was configured to listen to port 3306 (the usal MySQL port) and MySQL 8 was listening on port 3308. If you are in this case, don't be fooled by the fact you have 2 DBs.
To solve this, you have to choose the DB you want. I wanted MySQL and I just ask MySQLWorkBench to open a connection on port 3308 to MySQL.
You can ditch MySQL Workbench, and use the browser made for the MariaDB, they have a free version here: https://www.upscene.com/downloads/dbw
It's limited in its abilities, but I had no troubles connecting and browsing.
I had the similar problem because i was using Denwer at the same time.
To solve the problem:
Stop Denwer
Restart MySQL server
Profit! Now you can open your database in the Workbench
The idea is that denwer was starting its local server which didnt allow MySQL to start normally.
If you want to use denwer at the same time wth MySQL you can just start it after MySQL (Point 4).
In my case I already had MySql server and workbench installed and setup prior to my XAMPP installation. I wanted to continue with my existing setup.
I also installed MySql server with my XAMPP. I started mysql inside XAMPP and when I connected to MySql Workbench, I encountered the same error. Because Workbench was trying to connect with the server which was installed with XAMPP, apparently this was incompatible.
So I stopped mysql in XAMPP and started started mysql server manually(the previous setup and installed server).
Refer this to know how to start mysql manually in windows.
You can also config XAMPP to use your existing SqlServer.
So I had the same problem. For me none of the methods worked, but then I found out that my MariaDB was occupying the same port, so I uninstalled it and that solved the problem.
i had same issue, i changed the mysql server port from 3306 to 3308 in XAMPP config file.
[mysqld]
port=3308

MySql is not connecting on default port. Maybe because I had MAMP

here´s my problem.
I was required to install MySql server as a local process to create a development environment. I use Mac OS X Yosemite. Pretty normal...
But...
After the installation... I noticed that mysqld connects on port 3307 instead of 3306.
I also noticed that I had MAMP previously installed.
So... I removed MAMP (not sure if did it the right way... erased the folder and it´s contents)... Removed MySql (removed all mysql folders on var/local and on /etc)... Removed even Workbench (leap of faith...)
Reinstalled Mysql and........ NOTHING... still connects at 3307..
So I changed my.cnf in /etc... and...... NOTHING again... mysql seems to be ignoring my.cnf...
I´ve searched for all my.cnf files possible... and made sure that the port line is commented on all of then...
Please... I can´t sleep anymore... Help me!!!
I had same problem and i couldn't change mysql ports from configuration files.
SOLUTION :: You should change your launch daemon configurations(or com.oracle.oss.mysql.mysqld.plist) from /Library/LaunchDaemons
MySQL Launch Daemon configuration link

can i share the same mysql db between xampp and mamp (mac amp)?

i'm doing some test with xampp and mamp (on macos x snow leopard), sometime i switch between them just to play around , the issue that each of them have their own db in separated location :
xampp in /Applications/XAMPP/xamppfiles/var/mysql/
mamp in /Applications/MAMP/db/mysql/
I don't want to deal with 2 separated mysql db data, i just want to have one , so i can share it to both xampp and mamp (not at the same time). I can update my db without worrying to update another db. Is this implementation is possible ? Does anyone know how to do it without any conflict ?
i'm using mac (so it's mamp), but this can be implemented on other system as well.
THanX
I did something like this on Linux. I needed to run two different versions of PHP but use one MySQL database. I had Apache/PHP installed in Linux as normal and I also installed XAMPP to run a different version of Apache/PHP.
Your setup is similar so the following should work so that both MAMP and XAMPP use the MAMP MySQL database.
I changed the PHP config in XAMPP to use my main MySQL db. Like so:
Locate the file php.ini in XAMPP (mine was in the the etc/ folder of XAMPP).
Open the file in a text editor of your choice and find the default socket it uses for MySQL.
Change this to use the socket
provided by MAMP.
mysql.default_socket = /path/to/mamp/mysqld/mysqld.sock
Save the file and restart Apache in XAMPP.
There is no need to start MySQL in XAMPP anymore as PHP should use the socket connection from MAMP.
XAMPP should now use the database from MAMP.
This should work :)
I thinks it should be possible. Give a try to following technique.
You can start XAMPP. Now Your Apache and PHP of XAMPP will work with mysql of XAMPP.
You can start XAMPP then stop Apache and PHP service of XAMPP. Then start MAMP. Stop mysql service of MAMP. Now Yor Apache and PHP of MAMP will work with mysql of XAMPP.

What is forcing my system to look for MySQL in "/opt/local/var/run/mysqld/mysqld.sock"

I have been trying to get a ruby on rails app going on my machine for a little while now for a project I need to work on for work. The issue is, my system must be setting the default location of MySQL somewhere because every time I start the rails webserver (webrick) and run localhost:3000, I get the following error.
"Can't connect to local MySQL server through socket '/opt/local/var/run/mysqld/mysqld.sock' (2)"
I have deleted the installed version of mysql and removed all folders. I reinstalled mysql using BREW. I now have a running mysql instance. The output of "which mysql" prints "/usr/local/bin/mysql" which is actually a sim link to "/usr/local/Cellar/mysql/5.5.14/bin/mysql".
Does anyone know what might be forcing my rails apps to look for mysql in "/opt/local/var/run/mysqld/mysqld.sock"
NOTE: I deleted my current my.cnf because it was messing up the brew version of mysql I currently have running, so I know that is has nothing to do with that.
/opt/local is the default location for MacPorts-installed packages. Chances are you installed rails and or MySQL via MacPorts. Try:
sudo /opt/local/bin/port installed
to see what is installed.