How can be done a SQL query which is not implemented inside the browser interface? - mysql

With the rise of home office I have to went and do all class of stuff via a web interface inside a database, the problem is that the developer did not add a field or page to formulate a custom sql query.
I understand that the php query parser its on files located in the server side (process.php and all that) so these cant be modified (and I dont intent to do that). The idea is to view/know how many fields are inside a certain database, since the work requires the existence of 2 specific fields that via the web interface does not seem to appear, and to know if these fields exists or not, so the data can be inserted in an accord format (and to request to the developer add it).
I have the legit access to the server, so how can the sql query be piped directly to the server outside the web interface?, or, since Im a valid user, a terminal session can be launched to check the structure?
The developer team is not responding, and left us with some issues,but this is the most needed.
Web server: Apache (dont know the version but guessing its from the
last 2.4.4x branches)
Server: Some flavor of linux.
SQL :Postgresql 11.x/12.x (but not sure, it can be mysql)
Thanks.

Related

MySql Workbench and Html Sublimetext 3

I have been writing SQL queries for a while now, but brand new to HTML.
I have been using Sublime text to code HTML and using Mysql - Workbench to code databases etc on local server.
I'm wondering..
How do I code HTML to return SQL queries onto a console (Google Chrome)? and connect the two together
I have searched all over google and You Tube, only thing I can find is something to do with PHP.. not sure what how it works, but don't think that is something I need.
All I want to do is create a text box inside HTML and input id value as an example 10 and return the id number along with the whole row from the database.
Using this query: select * from tableName where id = 10;
HTML is a document formatting language. While it supports JavaScript, said JavaScript is sandboxed in the browser: It cannot easily access files and the like even when that other stuff is running on the same computer as the browser. The main reason here is security. Imagine every web page on the Internet could look at every file on your disk, copy them or save new files on your disk or modify them.
So what you need is a "server software" of some kind. This software talks to the browser. It sends it all the HTML that the browser requests. The HTML can then ask for more (for example using JavaScript and AJAX). These requests go to the server which parses the parameters, collects the data (only the server talks to the database) and sends results back.
This is a pretty complicated and involved process. For this reason, everyone uses a framework to do it. The framework handles all the ugly stuff like converting query results from the database into the types and objects of the programming language and then again to HTML code which looks good.
Since you don't know any programming languages, yet, I suggest you start with Python. A good web framework for Python is called "Django". Django also contains modules to talk to databases. It also has many "widgets" like tables that display query results.
Google for "python django mysql" which should give you plenty of examples.

Empty Object Explorer When Opening a H2 embedded database(.mv.db file) in DbVisualizer

EDIT: Please ignore the Database Type "MySQL". I have it set to H2 currently, I was just playing around with settings at the time of the screengrabs in an attempt to see if I could pinpoint what was going wrong.
My friend came to me tonight with an "Opportunity". He had a college student code a front end application to insert, update, delete, and view data on a local drive for a small company that he runs. The application broke when he updated windows, and now he needs to retrieve the data. He sent me the .mv.db file, so I did some digging and found that DbVisualizer could allow me to atleast use a simple MySQL query to pull his data out into an excel spreadsheet. According to him, there are only about 300 records in the database.
When I connect to the embedded H2 database, it opens up two empty databases.
Let me know if anybody knows what to do here. Thanks.
I ran into the same problem. Luckily my database was small as well so I could use SQuirreL SQL Client to open the database. It is not easy to get used to the user interface but it does a really good job.
If you want to export your data you probably want to change the settings (File -> Global Preferences, Tab SQL Script). I unticked the box 'Qualify .. with schema' to get valid SQL.
Also the date format is not standard conform. I used a text editor to get executable SQL.

Unwanted code being inserted into pages

Some of our ColdFusion sites are having the words "coupon" inserted into their footer with a link to another site. Is there anything I can do to prevent this? Is there any software I can run to help detect any vulnerabilities? It doesn't seem to be SQL injection as the databases seem fine and nothing unusual is showing up in the logs.
There are several variations of attacks that produce this sort of result (appending a link to some malicious or nefarious site). For example, this one (Script Injection) uses the latency between a file upload and checking to insert executable code on your server.
Other attack vectors include FTP (which is why you should not use it), or other file transfer protocols. In your case the infected machine may not be the server. It could be a client machine with access to the server - a developer who has set up FTP to the server for example.
Let me know if you need formal help - we have a good track record fixing this sort of thing. If you get more clues post them and I'll try to help. I will warn you that if this is a server infectionit is at the root level and is so pervasive your only option is to start with a pristine install and reinstall your code. Bad news I know - sorry :(
We had something similar happen when one of our servers was hit by the hack Charlie Arehart describes here:
http://www.carehart.org/blog/client/index.cfm/2013/1/2/serious_security_threat
Have you had these patches?
Another option that I would recommend is searching your site(s) for any use of the <cffile> tag that isn't expected. I had a customer that somehow got a single file that was a backdoor to their site. It was particularly dangerous because it could upload files to any location on the server as well as execute any SQL command against any datasource on the server. In other words, this single file opened the door to all of the sites and databases that were running on that server.
This backdoor file (which was named vision.cfm) was often used to update footers with links to coupon and spam sites. vision.cfm was only 210 lines of code.
The entire server had to be sanitized after this was discovered.

Connecting visual c++ to an online database

I am working on an app in visual c++ which requires data to be accessed from a database which can be edited so that every time there is a modification to the data I do not have to resend the app as it will automatically update, it is also required that this is a desktop app.
I am currently using MySql however for this to run constantly I will be needing a server which for a single simple app wont really be worth purchasing, so I started thinking of alternative methods and thought to myself there must be some method of reading directly from a website or online database, am I correct in thinking this? If so could someone please explain how I would achieve this?
Also, I have purchased phpmyadmin in the past so if there is any way I could connect my visual c++ app to a database from this then that would be great.
EDIT: Note, this app relies almost entirely on the database as it is just 3 combo box's and one text field all of that values for which come from the database.
The following response is assuming that by online you mean on the web.
You cannot exactly 'connect' to an online database with C++ (or anything outside of that server hosting the database).
What I would do is create some PHP API's that you can POST to with libcurl via C++. You can both send and receive data this way.

creating a basic database

Right now, in my internship, I'm assigned to create a system that holds employee information such as personal info, education, salary, etc.
All these stuff is kept in a few spreadsheets right now. I need a basic program, but I feel like I should be using MySQL or another database solution to hold the data. I used MySQL before, but it was a PHP/MySQL assignment which I used Wampserver to create the whole system.
Edit: The system will be used by a few computers across the network. When someone makes a change to the system, it will become visible to other computers aswell. (obviously) (Before the edit, I thought that it's gonna be used by a single computer.)
I'm confused right now. Should I create a PHP/MySQL webpage with wampserver (or similar) to hold the information, or not?
Would it be easier or better to combine MySQL with some other programming language (such as Java/C++) and build a GUI? (I doubt it)
Should I come up with a different solution? Without database usage?
Database usage would be the best option. In the end it will come down to what you are more comfortable using, Java/C++ or php, for what you want to do either can work, but remember the database will need to be live at all times and using wamp server wont cut it. You need to learn how to tun a mysql server without wamp, which is easy(Google is awesome). And personally I would have used Java because Java is also easy to link with mysql, just google it a bit, and java doesn't need to run on a server so no wamp needed as you would have needed for php.
EDIT:
Ok if I understand you correctly what you want to do is the following:
1. Identify a pc to be used as a server and assign it a static IP.
2. This must also be the pc that is turned on first every day and turned of last.
3. Create a front end client application that connects to your sql server that you will be running on the server machine.
Now I am assuming this network is rather small, so you wont need a specific computer to just act as server. The server can also be one of the client machines.
The best approach would be to create a mysql server and make sure the firewall is not blocking your sql server. Then create a client application that can access the database over the network using Java, I find this easier than creating a php server for the users because of port forwarding for an apache server is time consuming, I did it once and never again. Java will be easiest to make the application work over the network. Use Netbeans for the development, it's an awesome IDE and it makes life easier when setting up the database connection.
If you have anymore questions please ask in comment, and I will elaborate, since this might be a bit vague lol.
Of course you should use a database for this type of work. That is the best way to organize, search, sort and filter your data without having to reinvent the wheel.
As to the other questions, the choice of language and environment is up to you to decide after evaluating the needs of your application.
Your solution should use a database to store the data and an front-end application to manage the data.
The database and front-end should be seen as two separate layers. In other words create the database using whatever database your are familiar with eg: MySQL and likewise create the front-end using whatever technology youre familiar with eg: PHP.
Personally for this type of requirement i would typically use MySQL / SQLExpress and ASP.Net / MVC3 front-end.
Hope this is helpful.