mysql database connection- UNIX socket?

Joomla version 1.5 is end-of-life and are no longer supported. Please use Joomla 3.x instead.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
whitnight639
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Thu Sep 27, 2007 1:03 am

mysql database connection- UNIX socket?

Post by whitnight639 » Sun Dec 09, 2007 2:48 am

Hey guys,

How do I work out my UNIX socket for my site?

the phpinfo.php comes back looking like this :

System FreeBSD tau.digital-crocus.com 6.1-RELEASE-p3 FreeBSD 6.1-RELEASE-p3 #0: Wed Aug 23 04:38:42 CDT 2006 root@tau.digital-crocus.com:/usr/obj/usr/src/sys/TAU i386
Build Date Feb 28 2007 22:55:33

So I know my username and password for getting into phpmyadmin etc but how do i work out the UNIX socket to put into my configuration.php file?

var $dbtype = 'mysql';

var $host = 'tau.digital-crocus.com';

var $user = 'root';

var $password = '******';

var $db = 'healthfreedom';

var $dbprefix = 'jos_';


for example my ftp adress for a file looks like: ftp://whitenight639@ftp.digital-crocus. ... edom.co.uk


so how do i work out my username and password for my mysql in configuration.php,
I've tried using TCP/IP (localhost / 127.0.0.1) im really confused,

the port im told is the standard 3306


:(

orrd
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Mar 11, 2013 3:49 am

Re: mysql database connection- UNIX socket?

Post by orrd » Mon Mar 11, 2013 5:10 am

This is an old thread, but apparently no one had answered the question before, so I'm answering it for other people who run into the same issue.

As far as I know there isn't a way to specify the UNIX socket for Joomla to use, but instead what you can do is edit your php.ini and set your socket path there with these configuration variables...

mysql.default_socket = ___
mysqli.default_socket = ___
pdo_mysql.default_socket = ___

Where "___" is your UNIX socket path.

enjie
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Oct 22, 2007 9:32 am

Re: mysql database connection- UNIX socket?

Post by enjie » Wed Apr 23, 2014 10:39 pm

Did you ever figure out how to get this done?
Am having the same problem using joomla 2.5

gijs007
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Sat Oct 30, 2010 1:43 pm

Re: mysql database connection- UNIX socket?

Post by gijs007 » Sun Mar 01, 2015 7:42 pm

I've just set this option as orrd has recommended, how can I check if its working?

paulnecsoiu
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Sat Jul 24, 2010 11:18 am

Re: mysql database connection- UNIX socket?

Post by paulnecsoiu » Fri Apr 08, 2016 4:17 pm

orrd wrote:This is an old thread, but apparently no one had answered the question before, so I'm answering it for other people who run into the same issue.

As far as I know there isn't a way to specify the UNIX socket for Joomla to use, but instead what you can do is edit your php.ini and set your socket path there with these configuration variables...

mysql.default_socket = ___
mysqli.default_socket = ___
pdo_mysql.default_socket = ___

Where "___" is your UNIX socket path.
I have this settings but when I try to install joomla I receive the following message.

Code: Select all

Could not connect to PDO: SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'
The mysql user database looks like this:

Code: Select all

MariaDB [(none)]> SELECT User, Host, Password, plugin FROM mysql.user;
+------+-----------+-------------------------------------------+-------------+
| User | Host      | Password                                  | plugin      |
+------+-----------+-------------------------------------------+-------------+
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B | unix_socket |
| root | 127.0.0.1 | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |             |
| root | ::1       | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |             |
+------+-----------+-------------------------------------------+-------------+
I know which generate the error and I know how to get rid of it, but I'm thinking that is not the recommended path.

So the error is caused by the mysql unix_socket authentication plugin (see https://mariadb.com/kb/en/mariadb/unix_ ... on-plugin/ which verify if the user who try to connect to database is authenticated on the sistem.
If you disable the plugin ( using

Code: Select all

MariaDB [(none)]> UPDATE mysql.user SET plugin='' WHERE User="root";
) the problem is solved.
BUT this make the connection method less secure. So I'm thinking that another option is to make joomla installation process to try connecting as the root. In other words when Joomla try to connect to database it must be authenticated on the system as the root user. How can we do that????

gijs007
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Sat Oct 30, 2010 1:43 pm

Re: mysql database connection- UNIX socket?

Post by gijs007 » Fri Apr 08, 2016 6:24 pm

Just use localhost instead of the UNIX socket, then in PHP set the UNIX socket for MySQL. It will then use the UNIX socket in Joomla as well.
paulnecsoiu wrote:
orrd wrote:This is an old thread, but apparently no one had answered the question before, so I'm answering it for other people who run into the same issue.

As far as I know there isn't a way to specify the UNIX socket for Joomla to use, but instead what you can do is edit your php.ini and set your socket path there with these configuration variables...

mysql.default_socket = ___
mysqli.default_socket = ___
pdo_mysql.default_socket = ___

Where "___" is your UNIX socket path.
I have this settings but when I try to install joomla I receive the following message.

Code: Select all

Could not connect to PDO: SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'
The mysql user database looks like this:

Code: Select all

MariaDB [(none)]> SELECT User, Host, Password, plugin FROM mysql.user;
+------+-----------+-------------------------------------------+-------------+
| User | Host      | Password                                  | plugin      |
+------+-----------+-------------------------------------------+-------------+
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B | unix_socket |
| root | 127.0.0.1 | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |             |
| root | ::1       | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |             |
+------+-----------+-------------------------------------------+-------------+
I know which generate the error and I know how to get rid of it, but I'm thinking that is not the recommended path.

So the error is caused by the mysql unix_socket authentication plugin (see https://mariadb.com/kb/en/mariadb/unix_ ... on-plugin/ which verify if the user who try to connect to database is authenticated on the sistem.
If you disable the plugin ( using

Code: Select all

MariaDB [(none)]> UPDATE mysql.user SET plugin='' WHERE User="root";
) the problem is solved.
BUT this make the connection method less secure. So I'm thinking that another option is to make joomla installation process to try connecting as the root. In other words when Joomla try to connect to database it must be authenticated on the system as the root user. How can we do that????
You shouldn't use root for Joomla (or any application for the matter).
Simply make a database + user for the application (e.g. Joomla) which only has rights on that database. Then use that user for the application/Joomla.

To make it more secure you can use a random generated password for that user and limit it to localhost only.


Locked

Return to “Installation 1.5”