I've set up an Apache 2.2 and PHP 5.3 server on my Windows 7 machine. However, phpinfo() tells me that I have MySQL installed as well, but I had no clue I do. I'm having trouble finding the installation, so how can I find the path to MySQL? I know how to do so with Linux (whereis MYSQL), but what do I do with Windows?
If you didn't setup MySQL explicitly, and you didn't install a complete WAMP installation, you don't have MySQL. PHP just checks if the MySQL library is installed. If you try to connect, it will probably fail.
I would check under C:\Program Files\MySql or under c:\MySql
Also, MySql typically is configured to run on port 3306; so I would
check whether you have this port open on your local computer. How?
Just telnet to port 3306 on localhost and see if you can connect. If
you can, most likely MySQL is running on your PC and you should be
able to connect to it.
Read the MySQL Documentation regarding this topic.
Related
I have a Raspberry Pi (first model) I use as a server. I followed a tutorial and installed Apache2, MySQL, Phpmyadmin etc.
I have also set up a ddns for my home network to be able to connect to it wherever I am, and of course forwarded the necessary ports.
At first everything worked wonders.
I could connect to the database using phpmyadmin by navigating to adress/phpmyadminfrom any network.
I could also use HeidiSQL to connect to the database, again from any network.
The MySQL version I had at this time was v5.5. I wanted a feature available on v5.6 but this version was not available on my RPi (ARMv61). Instead it seemed like MariaDB should do the trick. So I updated to MariaDB using the command:
sudo aptitude install mariadb-server
Now I am not able to connect through HeidiSQL anymore, Phpmyadmin still works though from any network just like previously. Trying to connect with HeidiSQL I get the output (no matter what username/password i try):
Can't connect to MySQL server on 'adress' (10061)'
mysql -V gives output:
mysql Ver 15.1 Distrib 10.0.27-MariaDB, for debian-linux-gnueabihf (armv7l) using readline 5.2
My RPi info is
Linux redface 4.4.26+ #915 Thu Oct 20 17:02:14 BST 2016 armv6l GNU/Linux
The user privileges are available in the image below
How can I connect to the database again using HeidiSQL? Have I missed something with the user privileges?
With phpmyadmin I use the username root
This particular error is not about permissions.
The code (10061) is WSAECONNREFUSED -- a Windows socket error code for Connection refused, not to be confused with "access denied."
Connection refused typically means no service is listening on the target IP address and port. MariaDB is not listening on 0.0.0.0:3306.
mysql -V only tells you the installed client version -- it doesn't tell you anything about the MariaDB server.
Access to phpMyAdmin doesn't tell you anything, either, because with it, you're not talking to the database server remotely -- you're talking to your web server remotely, and your web server is running code that talks to the database locally from within the same machine, and often uses a different mechanism of server access that is not TCP/IP.
Check the config file for a commented-out bind_address=0.0.0.0 or similar.
https://mariadb.com/kb/en/mariadb/configuring-mariadb-for-remote-client-access/
I am running Windows 7 Home Premium (yuck). I have MySQL already installed. The port I am using for various MySQL projects is 3306. I have used MySQL Workbench to create a database for a planned Drupal site. When I login as administrator and try to install WAMP, the installation program asks me to specify the port for MySQL. I enter 3306 and receive the error: "It seems you do not have enough permissions to bind to the port or the port is already taken by another application. Please select another one." When I try a different port and complete the installation, there are no servers listed for me to start. Is it possible to convince WAMP to allow me to use 3306, which is my preference? Thanks.
Switch of all other running programs, for example - skype. And restart your wamp server
I'm trying to learn the apache / mysql / php stack bundled with XAMPP. I can't connect to the MySQL server using the MySQL workbench:
Your connection attempt failed for user 'root' from your host to server at localhost:3306: Can't connect to MySQL server on '127.0.0.1' (61)
Thinking it's a port problem, I check the port directly in Terminal with the command telnet 3306:
telnet: connect to address 127.0.0.1: Connection refused
Obviously the problem isn't with the Workbench, but something to do with the port connection itself.
I'm using:
OS 10.8 Mountain Lion
XAMPP 1.7.3
MySQL workbench 5.2.47
Sorry all, I'm posting my own question and answer. I had this problem and it nearly destroyed me because I could not find the correct answer anywhere on the interwebz. I finally overcame it, and wanted to post my findings in case it helps another befuddled traveler.
It turns out when you install XAMPP and choose to run the security routines, it automatically turns on a setting in the MySQL preferences to block connections on port 3306 from localhost. To fix this, open my.cnf in the xampp folder xamppfiles/etc. Look for the setting "skip-networking" which tells mySQL to block the port 3306. Comment this out by adding a pound sign so it is "#skip-networking". Now, the telnet command should work, and you should be able to use the Workbench.
Hope this is helpful for somebody!If it fixes your problem, give me a shout at #mrcheeks3185.
I faced same problem but I solved it.
I changed the MySQL workbench port to 3307 in the file below
C:\ProgramData\MySQL\MySQL Server 5.7\my.ini
and keep the default port 3306 for XAMPP
for mac you should create only a user with password and grant access(in my case a I use root with password) and turn on ip address and use that address to connect with a client like navcat or workbench I use XAMPP 7.3
ip address network given by XAMPP
connection config in navcat
test connection
I found that file after mount the image disk created for xampp, there you can find new_disc_mounted/etc/my.cnf
If you do not have my.cnf you can first go to xampp->mysql->bin->my.ini, copy
the contents of the file, next create my.cnf (in the bin folder) and paste the content to the file you just created.
This works for me. I had the same problem. Now I can use both Xampp and Workbench on one PC.
There is an issue: when you start workbench you get some warning that some features may not work properly since database is not fully compatible.
If changing ports won't work. What I did, I just make sure both XAMPP and MySQL Workbench don't start the server at the same time. Just go to MySQL Workbench, Select Server > Startup/Shutdown > Shutdown.
its due to different version of xampp, open log file and check last status of mysql there is showing error find it or remark/change it
Actually XAMPP and MySQL workBench might be using same port an are conflicting "3306" in so you are getting that error
Please try changing the workBench's default port number to other number and try again
Exactly what the title said; I'm trying to configure an ODBC connection for MySQL 5.0, but upon clicking Test Data Source, it returns the above error.
I'm pretty sure most of you have seen this question before, and I did do some research before thinking about posting this, but so far, none of what I found and tried were able to help.
I'm using MySQL 5.0, running on Windows 7 32-bit. I can browse the database fine with the MySQL Query browser which means (I'm assuming) that the username and password are fine.
There is a 'MySQL 5 - Started' under Services. I named it that way because I had installed an older version of MySQL (3, iirc) for a project. Since I don't need it yet, I disabled it (it's not running).
Here's what I tried:
Firewalls were disabled to begin with.
Replacing the 'localhost' with '127.0.0.1' (Didn't work)
Going into Command prompt, cd to C:\Program Files\MySQL\MySQL Server 5.0\bin, and executing mysqld-nt (I have no idea what that is for, but it didn't do anything)
Running 'Telnet localhost 3306' in the Command Prompt returns 'Could not open connection to the host , on port 3306: Connect failed.
Stopping the service, going into C:\Program Files\MySQL\MySQL Server 5.0\data, deleting ib_logfile0, ib_logfile1, and ibdata1, and then restarting the service (Didn't work).
I'm assuming here that it might have something to do with the port 3306, as typing netstat -a in the command prompt gets me a list with no 3306 in it (as far as my eye can tell), so I'm not really sure how to proceed (port forwarding? Don't know how to do that).
Any help would be much appreciated. Thanks.
I had same problem before, please check your Mysql Service and make Startup Type as Automatic and Restart.
If you really tried most of the solutions and still didn't succeed, try to delete or rename(to any name) the ib_logfile0 and ib_logfile1 in the data folder of mysql. For me the path is wamp/bin/mysql/mysql5.6.12/data. because i am using wamp. And run the mysqld service. May it helps you. Good luck.
MySQL server might got stopped.Please check the status of MySQL server in the services if it got stopped please start the services and try to connect again.
You said
Replacing the 'localhost' with '127.0.0.1' (Didn't work)
For my network (in mysqld.cnf) replacing 127.0.0.1 with 0.0.0.0 just worked... connected.
I have MySQL installed in the /usr/local/bin/. I need to be able to connect to the MySQL database, however, the mySQL gem cannot connect to my database, and it seems that it is looking for the database in the /opt folder.
Can anyone suggest how I can fix this?
Some thoughts about this:
Have you checked if MySQL is actually running? In most linux environments this can be done on the command line by executing "/etc/init.d/mysql status" or simply connecting to the database with the command line client.
I think your configuration should point to "localhost" when running on the same machine and is then using either sockets or tcp connections to connect to the database, so the /opt folder message you posted seems weird.
Please provide more information.