Creating connection to mySQL

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

Creating connection to mySQL

Postby dgwaring » 29. July 2016 00:28

I need to know how to confirgure XAMPP to connect to an existing mySQL instance on my local machine. The connection is specified as connection method: Standard (TCP/IP) hostname: 127.0.0.1 port 3306 username: root in the connection on my mySQL Workbench. How do I get XAMPP to talk to this connection.

I imagine I need to edit the my.ini file that is asscoicated with the mySQL module in XAMPP but I don't know how to go about doing this. Thanks Daniel
dgwaring
 
Posts: 2
Joined: 29. July 2016 00:21
XAMPP version: 3.2.2
Operating System: windows 7 ultimate

Re: Creating connection to mySQL

Postby Altrea » 29. July 2016 07:13

What do you want to achieve exactly?

Do you want to control your existing MySQL instance with the XAMPP control panel? This is not possible without recompiling the control panel sources, the paths are hardcoded.
Do you want to use your MySQL Server with your webapplication scripts? Then there is nothing to do. MySQL is loosely coupled. You just need to specify the connection in your webapplication.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Creating connection to mySQL

Postby Nobbie » 29. July 2016 10:48

dgwaring wrote:I need to know how to confirgure XAMPP to connect to an existing mySQL instance on my local machine. The connection is specified as connection method: Standard (TCP/IP) hostname: 127.0.0.1 port 3306 username: root in the connection on my mySQL Workbench. How do I get XAMPP to talk to this connection.


"Xampp" does not connect to MySQL anyway, Xampp is a software collection of Apache (Webserver), MariaDB (SQL Database) and PHP Interpreter. None of them need to "connect" to your SQL Database, your own PHP scripts need to do so. So if you already have a running MySQL Server, do not start MariaDB in Xampp (it would collide with the existing MySQL Server), and finally simply run your PHP scripts and use the credentials for your database as shown above.

All in all, there is nothing to do. Run your PHP and thats it.
Nobbie
 
Posts: 8761
Joined: 09. March 2008 13:04

Re: Creating connection to mySQL

Postby dgwaring » 29. July 2016 16:02

Thank you both, that is very helpful. Mostly the issue is my learning what these tools are and how they work together. I think my path forward is to work with the xampp stack to develop the web scripts that I need and then connect to my existing mysql. Only trouble is I have an awful lot to learn about writing PHP scripts. But its fun to learn. Thanks again.
dgwaring
 
Posts: 2
Joined: 29. July 2016 00:21
XAMPP version: 3.2.2
Operating System: windows 7 ultimate

Re: Creating connection to mySQL

Postby Altrea » 29. July 2016 16:11

You are welcome :)

btw: Please update the XAMPP version number in your Board profile. 3.2.2 is not a valid XAMPP version number.
More to read where to find the correct version number here: [Q&A] Insufficient debug information - base information
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8286
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 1 guest