I was wondering if someone could help showing detailed steps (if possible) to make MySQL accessible remotely. Example: PC 1 has MySQL installed (DB server) on it and PC 2 can now ask PC 1 for data using either PHP, Python etc.
First, I would like to give credits to the people who assisted me when doing this. I will outline how I managed to get this to work. This was done on a machine running Windows 10. The steps are outlined below:
Installing MySQL and Location my.ini file
After installing MySQL server and workbench. Windows store my.ini file on a hidden location other than that of the MySQL installation location.
C:\ProgramData\MySQL\MySQL Server 5.7
This location can be view only when you have enabled windows to show hidden files. This is achieved with the following steps:
Navigate to Control Panel
Click on Appearance and Personalization
Under File Explore Options, click on show hidden files and folders
Under the view tab, Advanced settings, look for the option hidden files and folder and select the show hidden files, folders and drives and click ok.
Navigate to C:\ and you should see the ProgramData folder
Copy this file onto MySQL installation folder
Navigate to
C:\ProgramData\MySQL\MySQL Server 5.7
and copy the file to
C:\Program Files\MySQL\MySQL Server 5.7
Configure MySQL for remote access
open my.in file using your preferred editor and look for the line and remove the # in front of it to uncomment it:
bind-address=0.0.0.0
if the line is not there then add it manually save and restart MySQL or the machine.
Activating Telnet
The computer must have the telnet activity-activated, to achieve this the do the following steps:
Navigate to Control Panel -> Programs -> Programs and Features and under this section click on Turn Windows features on or off
Look for Telnet Client and check it
Click Ok, and done now telnet is active.
On the MySQL, workbench creates a new SQL connection and use the IP address you used on my.in file and you should be set to go.
Now test this by writing a simple PHP or Python script to connect to your MySQL server.
Related
For my web database I am trying to create a webserver so I need to make a conf file. When I try to edit my conf file and save it wont let me and says permission denied. I have already given myself read and write access, but I still don't have access to the edit the file. Here is the link to the resource I am using to set up my webserver : https://github.com/orsenthil/adminer-on-mac
I've been working with local web servers and mysql on Mac for over 15 years, so this recommendation is coming from that experience.
OS X updates will destroy your local web development environment every time you do a major OS update... Don't use the built in Apache, PHP and MySQL. Use Homebrew to install independent web server components.
Now to your problems:
/etc/hosts is a file not a directory. Each line is a separate record. The line they gave 127.0.0.1 apache.local just means that your local computer will be accessible from http://apache.local. This hosts file can be used to avoid DNS lookups for any website.
The conf file you are referring to is the Apache VirtualHost file? OS X is very protective about files in etc. Have you tried sudo? If you change the permissions to your user, Apache may not be able to function.
I want to sync (share) A MYSQL database over several computers. My strategy here is to move the database to a DropBox directory so it can be used on multiple machines. I have found a clear description of how to do this on Windows, but the location of the database in the XAMPP directory and the names and locations of the mysql configuration files (my.ini on Windows, my.cnf on mac) are different. The config file directives are different enough that I couldn't get it to work on the mac simply by comparing the changes made in the Windows file.
I tried moving the MYSQL database and changing the my.cnf file as it made sense to me to direct the software to the new location and was unable to get it to work. I also tried leaving the config files along and attempting to redirect xampp with a symlink in the directory where it looked for the database folder. In neither case could I get xampp to fire up mysql.
I have had inconsistent success using symlinks with xampp, using them primarily to redirect xampp to a new php localhost directory. In this case I couldn't get it to do this with mysql.
Does anyone know how to do this, i.e. which setting in the my.cnf file need to be redirected (I've tried about every variation I could think of) or how to get it to follow a smylink to the alternative directory?
Thanks in advance for any help.
--Kenoli
if you are on a Local Area Network you can simply use one of your PCs as a mysql server and connect to the database using the local IP address. If not, I solved this using Hamachi, and using the Hamachi ip address of the pc you want to use as a server. I know this is not a direct response about the symlinks and DropBox, but it solves the problem.
I'm trying to connect to MySQL using Netbeans. In Step 6 of this guide on how to do so, it says:
In the Path/URL to admin tool field, type or browse to the location of your MySQL Administration application such as the MySQL Admin Tool, PhpMyAdmin, or other web-based administration tools.
Note: mysqladmin is the MySQL admin tool found in the bin folder of the MySQL installation directory. It is a command-line tool and not ideal for use with the IDE.
So I need to find the location of the admin tool I'm using. I have PhpMyAdmin as part of the Uniform Server, so I tried to use that. But I can't find it. I manually DFS'd the UniServerX directory and couldn't find one single file which relates to PhpMyAdmin. There was a directory called "PhpMyAdmin" containing a bunch of files, none of which looked like the right ones. I did a search, and could only turn up that directory.
This is the full directory for PhpMyAdmin:
This is the form I'm trying to fill in on Netbeans:
I tried selecting "db.opt", but that wasn't the right file according to Netbeans. What should I be putting in this form? Which file singularly corresponds to PhpMyAdmin, and where should I be able to find it on my system if I have UniServer installed?
PhpMyAdmin is a web interface for managing a MySQL database. I think what you are looking for is something like one of these (try them in your browser): http://localhost/phpMyAdmin/ or http://localhost/apanel/phpMyAdmin/
The path in NetBeans can be configured to whatever you would like, you can even leave it blank. Its just a shortcut to open the admin console.
I would suggest setting it to UniController.exe (its in the top level folder of the UniServer installation). Through that tool, you can start/stop the server, and it has a button to open the PhpMyAdmin console.
I have installed xampp while port 80 wasn't free. As a result one of the services wasn't able to run. Then I tried to reinstall the program as I thought it would replace any services that I had already installed. I ended up with having the other port being used from the previous MySQL service that had been downloaded when I firstly installed XAMPP.
I decided to uninstall xampp completely and reinstall it from the beginning. I've uninstalled XAMPP successfully, however when I check my program files the MySQL service is still there. I tried to delete it along with the other files but it says that I cannot complete the action because MySQL is in use.
How do I delete MySQL so that I can download XAMPP again from the beginning without any problems?
To stop the Windows services, go to Start, Run, and type services.msc . Then, locate the Apache and MySQL services and stop them. If the XAMPP Control Panel is running close it.
To uninstall the Apache service, open a Command Prompt window with administrative privileges and execute the command:
C:\xampp\apache\bin\httpd -k uninstall
To uninstall the MySQL service, execute the command:
sc delete mysql
If you used the ZIP archive to get XAMPP, you should be able to simply delete the XAMPP directory. If you used the installer, uninstall XAMPP from Programs in the Control Panel.
If MySQL is running, you can access it via the command line interface:
Start -> Type "Cmd" in the Search box -> click on program (Windows 7)
Then in the command window you can use MySQL commands. If you want to manage MySQL databases via a graphic UI you have to use phpMyAdmin, which ships with XAMPP.
To Delete MySQL, first stop the windows service (if it's actually running as a service). You can view the running services by opening the management console:
Start -> Type "View Local Services" in the search box -> Click on the program
You can also view the services via the control panel. Find the MySQL service in the list and disable it, you should then be able to delete the program
If MySQL isn't running as a service but you still can't delete it you can either shut it down via the command line: mysql> quit or by killing the task in the windows task manager.
For you to get rid of the xampp folder in your (c:) drive, Go to Start, type msconfig in the search bar and enter. In the start up program, disable mysql services and the Apache program. Restart your computer.you are now good to go.
To delete the whole Xammpp on your computer you get probably an error that not all the files can't be deleted. To delete the files without any problems go to
task manager -> services -> services (with admin rights). Once you are their go and find
mysql service and the Apache service. Stop those two servers and you can delete the other files at your xampp to get xampp deleted.
Lots of conflicting reports out there when I google; can anyone help?
Basically I want to have the same databases available at work & home PCs, for development porpoises only.
I will only ever be physically at one PC (with a 45 minute trip between) and only then will there be database access. The MySql service will be running on both, but only one will be write/reading the database. Both run Windows 7
I don't need to bother with symlinks, junctions, etc as I have enough space in my DropBox to install all of Xampp there.
Can I do that without corruption?
I use something similar as part of my remote development testing, I have never tried to run a large set of data from this or a production database. Haha, but for testing queries and setting up a couple rows, etc... I use something very similar with little to no problems.
I believe that you can run the portable xampp and mysql from your Dropbox just go to www.portableapps.com to get the xampp and also download the portable launcher from the link on the page.
Let XAMPP server run on your computers, and the data folder saved on your cloud (DropBox, SkyDrive, etc).
You should install XAMPP portable on your root folder (c:) that is the same on all computer you use, then you can move XAMPP data folder (xampp Apache htdocs) and MySQL data (xampp Mysql/data) folder to Dropbox.
Do not use XAMPP installer, but use the portable one.
Configure the folder settings on both Apache and MySQL config file:
C:\xampp\apache\conf\httpd.conf
C:\xampp\apache\conf\extra\httpd-ssl.conf
C:\xampp\apache\conf\extra\httpd-xampp.conf
C:\xampp\mysql\bin\my.ini
Do the same with other server that you use (PostgreSQL, etc).
Make sure that you:
Always turn off XAMPP server after using on each PC.
Always sync Dropbox before changing PC, that is before logging on and after logging off on different computer.
Mind host / local domain variable on each computer.
Its probably better to use same username for all computer you want to use to run the data folder.
Other method is using PortableAppas.com, that is running the apps directly from USB.