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: 8965
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: 9772
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: 8965
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Creating connection to mySQL

Postby espi62@msn.com » 16. February 2017 21:54

I have the same situation where I downloaded the recent xampp with MariaDB as the database server. I also downloaded MySQL Workbench and MySql community Server. I went to Manage My Server control and stopped MariaDB database Server from xampp and turned on MySql server but shows error as follows.

Welcome to phpMyAdmin
Error
MySQL said:
Cannot connect : Invalid settings
Connection for controluser as defined in your configuaration failed
phpMyAdmin tried to connect to the MySQL server, and the server reject the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the adminstrator of the MySQL Server.

Please note my operating system is Sierra for Macbook pro Apple. Thank you in advance.
espi62@msn.com
 
Posts: 4
Joined: 10. August 2012 01:41
Operating System: Window 8.1

Re: Creating connection to mySQL

Postby HokuApps » 15. September 2017 06:22

Open MySQL Workbench.
Click New Connection towards the bottom left of MySQL Workbench.
In the "Set up a New Connection Dialogue" box, Type your Database connection credentials.
Type your password and click the "Save Password in Vault" check box.
HokuApps
 
Posts: 22
Joined: 11. September 2017 07:23
XAMPP version: 1.8.0
Operating System: Windows


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 3 guests