Can't find where the socket configuration is in XAMPP for Windows

吃可爱长大的小学妹 提交于 2019-12-25 08:03:04

问题


I'm using Netbeans 7.0.1 in a PHP project.

I've installed XAMPP 1.7 in Windows 7 64 bits with the installer we can find in xampp.org. I've changed the port of apache from 80 and 443 to 81 and 442 since I'm using IIS as well. I didn't installed anything as a service, I'm using the Control Panel to start/stop mysql, apache, etc.

My problem is that my unit test are failing, and the context is that I'm developing the project with two guys who are working on Macs.

They have a configuration file with a line like this:

database_socket = /var/run/mysqld/mysqld.sock

My unit test are failing and they told me that one of them had the very same issue and changing that path to the correct one fixed his problem.

Now, Where is that file in the Windows XAMPP? I made a search in the whole hard drive (I know mysql must be running for that file to exists, and yes, it is running :)) and I couldn't find it.

This guy is using a file named Parameters.ini where the socket path is specified then he call $container = $kernel->getContainer(); and the database seems to be instantiated.

I tried to changed that file (parameters.ini) which has right now this:

database_host = localhost
database_socket = /var/run/mysqld/mysqld.sock
database_user = user
database_password = pass
database_schema = lad

but if I remove database_socket it complains.

I tried to follow the instructions here: http://www.devside.net/guides/windows/mysql Setup (changing www with xampp)

Unpack as C:\www\mysql-5.1.56-win32

Rename directory C:\www\mysql-5.1.56-win32 to C:\www\mysql

Copy MySQL configuration file C:\www\mysql\my-medium.ini (or your choice of one of the other included my-*.ini files) to your %SYSTEMROOT% directory

Rename file %SYSTEMROOT%\my-medium.ini (or the copied over my-*.ini file) to my.ini

Edit %SYSTEMROOT%\my.ini

Under Sections "[client]" and "[mysqld]", edit...

socket = C:/www/tmp/mysql.sock

Under Section "[mysqld]", insert...

basedir = C:/www/mysql/
datadir = C:/www/mysql/data/

Restarted mysql, but nothing happened.


回答1:


The solution is to put the socket line with an empty value.

socket = ""



回答2:


According to http://dev.mysql.com/doc/refman/5.1/en/connecting.html#option_general_socket the default name for windows installations is MySQL.

For xampp the default location for the socket is C:/xampp/mysql/mysql.sock on my machine I do not have a sock file. I tried to get it to create one but without luck. If you can find a way to create it your going to want to edit /mysql_start.bat to include the commands or edit the default my.ini located in C:/xampp/mysql/bin/my.ini




回答3:


For Windows database_host, database_user, database_password, database_schema and database_port (3306) is enough, no need to set database_socket.



来源:https://stackoverflow.com/questions/8074461/cant-find-where-the-socket-configuration-is-in-xampp-for-windows

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!