Local use of MySQL database - mysql

Is it possible to use MySQL local? I mean NOT at a server. I read a lot about MySQL on a webserver with PHP, Joomla etc.
I want to program a piece of software and use a database local to store results. Can I use MySQL for that?
If so, is ther anyware on the net a good tutorial how to do that?

You can install MySQL on your workstation, it doesn't need to be on a "server" per se. You still need to use something that can connect to it. From a Java application, for instance, you'd use JDBC; from .Net, you'd probably use ADO.Net; etc.
As far as I know, it will still want to have its server process (mysqld) running and for you to connect to that process via sockets and the like; there's no standard in-process version that I'm aware of. (The server can be listening only on the local interface, though.) There are several alternatives if you want in-process stuff, such as SQLite and HSQLDB.
Of course, if you're feeling really enterprising, there's the open source version of MySQL, which means you could compile it into your app (if you're using C or something that can link to it), but I suspect that's going rather too far. :-)

Yes, works like a charm for this.
Mysqls homepage has lots of info for this.

use SQLite. it is a popular embedded database.
It can be deployed via XCopy and no server installs.
But it can only be used locally. i.e if you later on decide to allow remote access, then you will need to migrate it to MySQL or other databases.

Try xampplite - it will painlessly install MySQL for you (on your local windows machine) as well as apache, php and a few other web apps if you need them.

If you don't want to install a server, you may be interested into Sqlite! It's the most widely deployed embedded database, and it's Public Domain.
http://www.sqlite.org/
Firebird is also an alternative. It's fully ACID-compliant and runs under the Interbase Public License.
http://www.firebirdsql.org/

Related

How to edit code on server directly in VScode

I am writing code that will be deployed to a server. Right now I have to upload the code each time I change it. Is there any way to edit the code live on the server in Visual Studio code?
As there are some extension in the editor who provide that function this can be done in VS Code very simple. Just search in extensions for Keyword 'FTP' ...
Two Examples:
https://marketplace.visualstudio.com/items?itemName=humy2833.ftp-simple
https://marketplace.visualstudio.com/items?itemName=lukasz-wronski.ftp-sync
Both are very popular.
At the moment I personally use FTP-Simple. But have a look on your own. It depends on the things you wonna do. And don't worry ... it's a little bit tricky at the beginning to figure out how to setup and how they work ... but when you are in it works fine.
It depends what hosting you are deploying to. You can SSH into your server with most providers and use a command line editor such as nano or vim. Keep in mind, this won't keep the version on your computer up to date and the changes will be overwritten if you redeploy. Alternatively, If you have a VPS and want to edit the files in an IDE on your local computer, maybe a file transfer system like FTP or SMB would work. I don't suggest it though, there are huge security issues with them.
For Azure web apps, I've found that the Azure plugin for VScode is a quick and easy way to deploy my app. It's not quite real time but it's very easy to redeploy after updating. https://code.visualstudio.com/docs/azure/extensions
This is what I use to connect remotely to a couple Raspberry Pis, and a home server.
https://code.visualstudio.com/docs/remote/ssh

Duplicating existing cakephp app for development

I need to make a development version of a cakePHP app with its own db so that a developer can work on it without disturbing the current users.
I thought it would be simple, I just copied the entire director /project to /project_dev and then copied the DB "project_db" to "project_db_dev". Then I went into /project_dev/config/database.php and changed the db to "project_db_dev".
When I went to see what I had done, I saw the app was still connecting to the same db, as if I'd changed nothing. I realized that the original folder name was referenced in /app/webroot/.htaccess so do I need to find/replace all instances of that folder name?
What steps should I follow to duplicate an existing cakePHP app?
You need to setup some kind of development lifecycle.
Generally speaking the developer shouldn't be doing any development on the server. The best way to handle it is locally using a stack of some kind such as Lamp (Linux, Apache, Mysql, PHP) switch out linux with other OS's. There are multiple cloud solution to these environments to such as Koding.com
Using something like Git for version control the developer can develop locally then push the code through to the server after is being thoroughly tested locally or on a dev server or some kind.
Keeping Dev work and Live work away from each other is key.
Could do with a bit more information.
If both databases are hosted on the same server and you have permission to access them both with the same user then all you have to do is change the name of the database in your database.php
If not you will also have to update the IP and any other additional settings port etc.
If you are still having troubles email me simpsond1988#gmail.com

WAMP MYSQL or MYSQL service on clients side?

We have designed an application using .NET framework. There is a client application and a server application. The client applications, webpages, android/ iphone applications fetch data from the server using the WCF service.
My issue here is that some of the data that can be set by the user on the application is being saved on the server but cannot does not reflect on the client side once the application is restarted, we have designed the application in such a way that every change on the client side will be reflected on the server side, this is done to make this a cloud based application.
Some of the settings changed or value input on the client side is updating on the server successfully but does noes reflect on the client machines using the direct MYSQL service. However there are absolutely no issues while using WAMP as the MYSQL service, i.e the clients using the WAMP server can see the changes made. We have tried matching the versions and also have tried new and old versions of the standalone MYSQL. Firewall settings all seem fine. Since we prefer to install the standalone MYSQL over WAMP on our customers machines, it would be great if you could shed some light on the possible issues. Is there any difference in the initial config of MYSQL and the default config of WAMP MYSQL.
Hence if there is any thing in particular to note or tweak in this regards it will be really helpful.
Thanks in advance.
I don't think you'll get a really good answer to your question, because the term "WAMP" does not refer to a specific package, but rather any package that includes Windows versions of Apache, MySQL and PHP (and sometimes Perl instead of or in addition to PHP). See this link for a list of some of the available packages:
http://en.wikipedia.org/wiki/Comparison_of_WAMPs
Those packages come with different standard configurations for MySQL. Since you didn't say which WAMP package (and version) you were using, there is no way of knowing in what way their standard configuration differs from a plain MySQL installation (where the version is also important)
Have you tried just running a diff on the respective config files?

Can the embedded MySQL DLL support multiple users processes accessing a DB?

I am currently comparing Firebird to MySQL Embedded for use in an application. I have found all the specs for Firebird and I am looking for a similiar document regarding MySQL embedded. If I can't find a document, below are the items I'm interested in for MySQL
Can embedded MySQL server support multiple users (1-10 concurrent)?
Does embedded MySQL server support multiple threads accessing the db?
Can a MySQL DB location be on a remote share (CIFS, NFS, etc.)?
Thanks.
I found the following presentation that had the information I was looking for.
Embedded MySQL supports one process at a time accessing a file
Unsure about multiple threads, but since it all is running in one process, this may be OK
MySQL can use a file located anywhere that acts as a drive letter.
Also, databases use the same file format between the standard MySQL server and the Embedded Server which allows these to be easily integrated into a client/server installation.
Hope this information helps some else.

How do I allow a user to install MySQL on a user's machine more easily so they can connect to it via a Java application?

Let's say I have written an application in Java that is programmed to use a MySQL database. The user of the Java application needs to have MySQL on their machine in order for the application to work.
What can I do to make sure that the user has the correct version of MySQL on their machine and if they don't then install it so they can properly run the Java application?
Note: I had sent some links to setup Java and MySQL for a business analyst of a program I am working on and he was not able to decipher the madness that is installing MySQL. He is not computer technical and wouldn't even know what to enter into the forms of the MySQL installation. What could I do to ease this task for the end user?
Update: Unfortunately, for security reasons that are a requirement for this project we have to use MySQL and not SQLite or Derby. Unless there is a way to make sure that no one deletes the SQLite database file or switches it out for another one. We need to guarantee data integrity and I find that using MySQL gives me the best chance at doing that.
What is the target platform?
Assuming something UNIXish, you can either:
1) Include a shell script to download, install, and setup mysql. Complicated, but not impossible.
2) Use an embedded Derby database. On my current project, we have a version where the user can just "download and go." That version uses an embedded Derby database that writes to a file, similar to hsqldb or sqlite3. Any of those are fine options.
The easiest thing for the user is to embed the database in the Java application. No setup required. There's MySQL OEM (not free), so you might consider switching to SQLite instead, which is the de facto standard embedded database. (See this question for more on that.)