Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
September 12, 2016 Mysql-native with LAMPP | ||||
---|---|---|---|---|
| ||||
Hi all! I tried the client driver for MySQL/MariaDB "mysql-native". https://github.com/mysql-d/mysql-native Everything works well with an individually installed version of MySql. But I would like to know if there is a way to make D programms work with LAMPP/XAMPP. I'm getting this error message while executing the program: host=localhost;port=3306;user=root;pwd=MY_testPa550;db=testdb Failed: std.socket.SocketOSException@/build/ldc/src/ldc/runtime/phobos/std/socket.d(2822): Unable to connect socket: Connection refused |
September 12, 2016 Re: Mysql-native with LAMPP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Geert | On Monday, 12 September 2016 at 05:31:46 UTC, Geert wrote:
> Hi all!
>
> I tried the client driver for MySQL/MariaDB "mysql-native".
>
> https://github.com/mysql-d/mysql-native
>
> Everything works well with an individually installed version of MySql. But I would like to know if there is a way to make D programms work with LAMPP/XAMPP. I'm getting this error message while executing the program:
>
> host=localhost;port=3306;user=root;pwd=MY_testPa550;db=testdb
> Failed: std.socket.SocketOSException@/build/ldc/src/ldc/runtime/phobos/std/socket.d(2822): Unable to connect socket: Connection refused
You're sure mysql is running?
|
September 12, 2016 Re: Mysql-native with LAMPP | ||||
---|---|---|---|---|
| ||||
Posted in reply to wobbles | On Monday, 12 September 2016 at 09:59:30 UTC, wobbles wrote:
> On Monday, 12 September 2016 at 05:31:46 UTC, Geert wrote:
>> Hi all!
>>
>> I tried the client driver for MySQL/MariaDB "mysql-native".
>>
>> https://github.com/mysql-d/mysql-native
>>
>> Everything works well with an individually installed version of MySql. But I would like to know if there is a way to make D programms work with LAMPP/XAMPP. I'm getting this error message while executing the program:
>>
>> host=localhost;port=3306;user=root;pwd=MY_testPa550;db=testdb
>> Failed: std.socket.SocketOSException@/build/ldc/src/ldc/runtime/phobos/std/socket.d(2822): Unable to connect socket: Connection refused
>
> You're sure mysql is running?
Yes, it's running. I started it with LAMPP, and i can access to the database through phpMyAdmin.
|
September 12, 2016 Re: Mysql-native with LAMPP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Geert | And are you sure it is using tcp4 socket on port 3306? You can use netstat -tlnp to see if is running on tcpv4 3306
Dne 12.9.2016 v 15:25 Geert via Digitalmars-d-learn napsal(a):
> On Monday, 12 September 2016 at 09:59:30 UTC, wobbles wrote:
>> On Monday, 12 September 2016 at 05:31:46 UTC, Geert wrote:
>>> Hi all!
>>>
>>> I tried the client driver for MySQL/MariaDB "mysql-native".
>>>
>>> https://github.com/mysql-d/mysql-native
>>>
>>> Everything works well with an individually installed version of MySql. But I would like to know if there is a way to make D programms work with LAMPP/XAMPP. I'm getting this error message while executing the program:
>>>
>>> host=localhost;port=3306;user=root;pwd=MY_testPa550;db=testdb
>>> Failed: std.socket.SocketOSException@/build/ldc/src/ldc/runtime/phobos/std/socket.d(2822): Unable to connect socket: Connection refused
>>
>> You're sure mysql is running?
>
> Yes, it's running. I started it with LAMPP, and i can access to the database through phpMyAdmin.
|
September 12, 2016 Re: Mysql-native with LAMPP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Kozak | On Monday, 12 September 2016 at 14:00:18 UTC, Daniel Kozak wrote: > And are you sure it is using tcp4 socket on port 3306? You can use netstat -tlnp to see if is running on tcpv4 3306 > I get nothing with TCP option, only when i run this command: # netstat -npl | grep mysql unix 2 [ ACC ] STREAM LISTENING 239449 6293/mysqld /opt/lampp/var/mysql/mysql.sock |
September 12, 2016 Re: Mysql-native with LAMPP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Geert | > # netstat -npl | grep mysql
>
> unix 2 [ ACC ] STREAM LISTENING 239449 6293/mysqld /opt/lampp/var/mysql/mysql.sock
Mysql defaults to unix socket, you need to add bind-address=127.0.0.1 to my.cnf [mysqld] section.
|
September 12, 2016 Re: Mysql-native with LAMPP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Martin Krejcirik | On Monday, 12 September 2016 at 15:02:50 UTC, Martin Krejcirik wrote: >> # netstat -npl | grep mysql >> >> unix 2 [ ACC ] STREAM LISTENING 239449 6293/mysqld /opt/lampp/var/mysql/mysql.sock > > Mysql defaults to unix socket, you need to add bind-address=127.0.0.1 to my.cnf [mysqld] section. That didn't work, but thanks anyway. Now is working. I had to comment "skip-networking": # The MySQL server [mysqld] user = mysql port=3306 socket = /opt/lampp/var/mysql/mysql.sock skip-external-locking #bind-address=127.0.0.1 # Don't listen on a TCP/IP port at all. This can be a security enhancement, # if all processes that need to connect to mysqld run on the same host. # All interaction with mysqld must be made via Unix sockets or named pipes. # Note that using this option without enabling named pipes on Windows # (via the "enable-named-pipe" option) will render mysqld useless! # #commented in by xampp security #skip-networking |
Copyright © 1999-2021 by the D Language Foundation