Access applications directly to XAMPP MySQL Server

In this article, we use the Linux operating system Ojuba 2 - 1 based on Fedora 10 framework framework, the account used here is root

TipsMake.com - In this article use the Linux operating system Ojuba 2 - 1 based on Fedora 10 framework framework, the user account here is root and suspend all operations of the MySQL database server :

/etc/init.d/mysqld stop

If you want to use the full function of the LAMP server with just one step, XAMPP is a great solution, but you will not be able to access the MySQL database server using mysql client as usual (/ usr / bin / mysql) , but instead, you must use the bundled client application (/ opt / lampp / bin / mysql).

And here are some problems that users often encounter, they have several databases, code snippets and other applications that need access to this database with the mysql client function (/ usr / bin / mysql) is the default mode, but there is no option to change all of the application's source code points to the XAMPP client.

First solution:

Move mysql client entry (/ usr / bin / mysql):

mv / usr / bin / mysql /usr/bin/mysql.original

Then create a dynamic link to the XAMPP client (/ opt / lampp / bin / mysql) in the same position as follows:

ln -s / opt / lampp / bin / mysql / usr / bin / mysql

Second solution:

In this method, we will work directly with the sock file, which is responsible for pointing activities directly to the database server. XAMPP regularly saves sock files in the following location:

/opt/lampp/var/mysql/mysql.sock

But for applications in the system, the following method must be applied:

/var/run/mysqld/mysqld.sock

In order for all programs to use the XAMPP database server, we must specify these programs to point to the XAMPP file, or simply, create a link to the XAMPP file in a separate address. Therefore, every program that wants to access the database server must point to the XAMPP server. Use the following command:

ln -s /opt/lampp/var/mysql/mysql.sock /var/mysql/mysql.sock

After executing this step, the applications are now able to operate, directly accessing the normal database without any hindrance.

5 ★ | 1 Vote