Allow Your Applications To Access The XAMPP MySQL Server Directly
Allow Your Applications To Access The XAMPP MySQL Server Directly1- Preliminary Note- I'm using "Ojuba 2" Linux ("Fedora 10" based distribution). /etc/init.d/mysqld stop
2- What is the situationIf you want to have a full featured "LAMP" server with one
step you can use "XAMPP", it's easy and fast but .......
3- What is the problemThis was a problem for me, I have some databases in the server and some other scripts and applications need these databases and using the regular "mysql" client (/usr/bin/mysql) by default, and there is no option to change all these scripts and applications' code to point to the "XAMPP" client.
4- The first solution (short one)Move the original "mysql" client (/usr/bin/mysql) to a backup copy. mv /usr/bin/mysql /usr/bin/mysql.original Then create a symbolic link to the "XAMPP" client (/opt/lampp/bin/mysql) in the original location like this: ln -s /opt/lampp/bin/mysql /usr/bin/mysql
5- The second solution (full solution)The second solution to solve that problem is to work with the sock file directly, the sock points us to the database server, applications that want to access the database server are looking for that file to know how to access it. XAMPP saves its sock file in this location: /opt/lampp/var/mysql/mysql.sock But the regular applications will deal with the file in this location (if there is one): /var/run/mysqld/mysqld.sock To make all applications able to use the "XAMPP" database server we need to tell all these applications to deal with the "XAMPP" file, or simply we create a link from the "XAMPP" file into the regular file location, so every application that wants to access the database server will be forwarded to the "XAMPP" server. We do this in one step: ln -s /opt/lampp/var/mysql/mysql.sock /var/mysql/mysql.sock After that all your applications should work as expected without problems.
6- Thank youThank you for reading this and I hope to hear from you even in this site or directly on my site.
|



Recent comments
6 hours 56 min ago
16 hours 23 min ago
17 hours 13 min ago
20 hours 46 min ago
1 day 1 hour ago
1 day 1 hour ago
1 day 3 hours ago
1 day 13 hours ago
1 day 18 hours ago
1 day 20 hours ago