How to remote connect to SQL server via php website [closed] - mysql

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have a laravel website and a MySQL database for it.
My website has few users, and any user has a SQL database on his computer and that database has the same name, same password, and same configuration.
Now I want my user login to my website and via website information, make changes to his SQL database on his computer.
How can I do this?
How can I connect to any SQL database on user's computer by my website?

The direct answer to your question is that if you know the details of your users' machines, you can create connection strings for them in your config file, and use those connections to open MySQL sessions on the client machines - see https://laravel.com/docs/5.5/database, section "Using Multiple Database Connections".
This assumes all the machines are accessible from your server - presumably because they are on the same, local, non-internet-accessible network.
If your user's machines are accessible from the Internet, please do not do this - they will get hacked. It's a question of "when", not "if".
It's also a pretty horrible solution from an application architecture point of view - presumably the databases on the users' machines expect certain things about the database to be true, and your application would have to guarantee all those things. For instance, your application might expect "all orders have a valid customer; all customers have a valid country code". That's hard enough to guarantee on a single database, but on a distributed system, it's really hard.
It's much better to use MySQL replication for scenarios like this.

Related

So I have a local MySQL server and database. How do I take it online? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
So, obviously I am less than a beginner at this, any help is appreciated.
We have an assignment for school, and the plan is to have a node-red project(on different computers) connect to a MySQL database hosted on a server.
I have downloaded the MySQL server package, the ODBC and Workbench. All that jazz. The thing is that I can't find a way to make my server hosted anywhere else than on my localhost. As you can tell, I have never even touched servers or anything like that before, so I'm probably just missing something.
As far as I know, a server is just a PC hosting data for other PCs to access, so what do I have to do to just make my PC a server? I need my colleagues/partners to be able to connect to the database from their local machine, but since it's hosted on localhost, that is not possible. I have not found a way to just "put it online". I realise putting stuff online without any knowledge of what you're doing is not something you should do, but I really feel like I'm out of options here.
As I said, any help would be appreciated.
why don't you host your database on a server online , try a free one for testing purposes, they are too many like :
https://remotemysql.com/
when you host your database you can access to it from any pc and also you can connect it with your PHP projects ex..

Query log file of mySQL database for analysis [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
We have log files of mySQL database and we want to use that log files for analysis (data mining, machine learning,...)
and iam very new with that.
Can you give me instruction how to do that ?
There are a number of tools that could be useful to you depending on your requirements.
But why use the MySQL logs and not the DB directly, or have the details you are searching for go to a new 'information mining' table in the DB as the user interacts with the interface. Which could be a lot more powerful
If you wish to determine the rate of inserts / queries.
You can actually set up MySQL to log these types of events to different files (so some of the work is already done, rather than having to mine a complete log file of all events).
Otherwise you are going to want to make use of tools such as Grep.
On top of that you have a system called Lucerne (from apache) that will mine the data and search for key words. They have various different hooks for going into Java, C, and others. Its very similar to how google trawl web pages.
Otherwise if you intend to mine the data 'within' the database, then the logs are clearly not your best point of call.
The logs will contain lots of information about the users also. IP address may be more tricky, but you could cross reference the name of the user running the query and the general server logs to determine the IP of the connection.

Creating an online mySQL Database [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
Is it possible to make an mySQL database on the web so that any person from any network can access it? For example if somebody in Europe downloads my program, it will still be able to connect to the mySQL database without problems.
Currently, I am using Connector J with a locally hosted mySQL database.
Edit: Basically I want to create an online mySQL database (not locally hosted) where anybody can download my program and the program from any internet connection can read and write the data from the server online.
Also are there any free online mySQL hosting services?
Edit:
For example, java games access data online from a database, but they are not on the same database. How can I achieve this? Are mySQL databases still the way to go?
It's difficult to understand your purpose but what I perceived from your question is maybe you are looking for some sort of cloud app service like Heroku. Take a look at their ClearDB add-on and see if that fulfills your need.
[This was supposed to be a comment but due to the lack of my Reputation points I have to submit it as an answer]

displaying data from mysql without user input--security concerns [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am working on a basic mysql application that will essentially take all of the data from a database and display it, with the only real user interaction being the ability to sort them. Since there is no place where the user will be able to input any data, I feel relatively safer creating this. The main issue I am worried about is when the app will have to log into the server. I created a separate user name on the server, and limited the privileges in the database so that particular user may only "select" data. I fear that this still exposes the location of the server. Should I encrypt this step? Are there any other security concerns I should guard against given this scenario?
If you need more information, I will happily add it on here.
UPDATE
It may be useful to know that the main function of this is to catalog merch for the purpose of commerce. None of the info in this database will be private. The commerce will occur with the help of a third party ecommerce site. I want to access the database using php mysqli and display it as html. The site is on a shared commercial server.
You should still use prepared queries for making the SQL queries in case the system later needs to support more kinds of queries (or if the system DB accounts are misconfigured or something similar.).
The location of your server doesn't need to be hidden, as long as it's sufficiently protected. You shouldn't rely on the attacker not knowing where the server is because they can usually figure that out. If your application knows the location of the server, it's safe to assume that the attacker can get it as well.
Instead focus your security on securing the server. Minimize the accounts on the server, ensure they have non-default (and non-trivial) passwords, make sure the software is up to date, etc.

How many MySQL database can be created in a single domain in Plesk control panel? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Do you have any experience about this question? I have currently 1900 MySQL databases in a single domain in my plesk control panel and I wonder if my MySQL server gets overloaded or out-of-service due to such high number of databases in the system.
Do you have any suggestions? Each database is for a user in my service by the way.
MySQL itself doesn't place any restrictions on the number of databases you can have, and I doubt Plesk does either, I'm sure it just displays all the databases present on the MySQL server.
However, your host may have a limit (which you'd have to ask them about), or if you start getting a huge number of databases, you may actually run into a filesystem limit. As the MySQL documentation says, each database is stored as a directory, so you could hypothetically hit the filesystem's upper limit for how many subdirectories are allowed.
ive got well over 5000 databases running on alinux based plesk cluster (one db one web server) and its running fine, though i have had to increase open files limits due to the huge amounts of files. i cant run the mysql tuning primer any more though, well i can but it takes about 4 hours