Using MySQL for a local database - mysql

I have written a program for a client that manages orders for his photography/souvenir business. However, I am trying to implement a DBMS for him so that he can do some analysis of the relevant trends over time.
The client's machine is a standalone Windows 8 PC.
I am attempting to use MySQL as he doesn't wish to purchase MS Access. However, he only wants it to be stored locally on the same machine he takes the orders on. How would I go about setting this up? I am new to database management so some detail would be really helpful!

You can follow MySQL's documentation to install. They have a GUI.
Once installed make sure to add a strong root password.
I would also create a database MyAwesomeNewDatabase specifically for your data. Then create a user for your application to use that is limited to just the database.
GRANT ALL PRIVILEGES ON MyAwesomeNewDatabase.* To 'user'#'localhost' IDENTIFIED BY 'password';
Then your application can use 'user' and 'password' to communicate. Specifying localhost means 'user' can only log in if on that machine, which you indicated is the case.
You indicated VB.net. You will need to install mysql-connector-net
Then in Visual Studio add reference to the dlls. Codeproject has a good tutorial on this.

You can always use DB at local computer. All you need to do is change the DB config done in your project. Change the address to localhost. I may be able to help more if i get the language you're working upon and the part of code where DB credentials are defined.

You can use Portable MySQL ,probably this Link help to you:
Designing Applications for Portability
You can always use DB at local computer Normally ...
sqlite is better for portable programming!

Related

How to make a mysql server publicly acessible with MySQL Workbench?

So I am developing an app that I want to let include server interaction. I have installed MySQL server and MySQL Workbench. I am able to query my data base locally from Java. such as local host. but when I change the query correctly, to reference the IP of my server and not "localhost", I am unsuccessful both on my server and separate machine. I have pinged my server from my another machine successfully. I have configured user accounts on MySQL workbench in almost every way possible. I have done a lot of googling with little success.
I am 19 and just starting to learn SQl now. It'sn ot a big part of my project. I am sorry if this sounds like a basic question, but google has gotten me no where and I am really eager to publish my app xP . So I would really appreciate the help or even a basic guide as to what I may be doing wrong.
Most likely, this is because you did not yet assign user permissions for remote computers. You'd have to use something like tyhe following:
GRANT SELECT ON myDatabase.*
TO myUser#’mycomputers.ip.address’ IDENTIFIED BY ‘my_password’;
There's a more extensive guide here:
https://support.rackspace.com/how-to/mysql-connect-to-your-database-remotely/

MySQL database hosted online

So I have created a mysql database hosted at db4free.net, and am able to access it easily from the command line or from java. My concern however, is I can only access it using my own username, password credentials. I tried to create user, but it appears I cannot as I get Access Denied. I'm assuming I don't have privileges to create users from this hosted database.
Now I want to include access to this online database in my application, but I don't know how without having major security issues. The only apparent way for another user to connect would be to include my own username, password credentials for the database but that is very unsafe.
Any ideas on how I can provide database access to users safely ?
From the front door page of the service you're using:
What db4free.net is not
db4free.net is a testing service which means it is not suitable for
production. There can be outages, data loss and security features do
not meet the standards which you expect from a professional data
hosting provider. If you need a MySQL database for production use,
please do not use db4free.net!
This seems pretty clear to me. Don't do what you're hoping to do!
Plus, it's not a good idea security-wise to open up a MySQL server to the public internet without using secured connections. Even then it's questionable. Somebody who reverse-engineers your app can pwn your database.

Tool for editing MySQL table permissions?

Is there a tool that makes the task of editing user privileges easier on a MySQL database? I've got nearly 100 tables to work through for 4 users, each with different per-table grants, which is getting tedious via phpMyAdmin. It'll get a lot more irritating when I make changes to the database structure and user list later on. I also can't see a way to do it in MySQL Workbench.
Are there any permissions management tools that make management of table permissions easier?
Update: For clarification, I need a tool that can manage the per-schema and per-table permissions for a user. I'll be changing permissions later, so it needs to be able to fully manage existing permissions as well as grant new ones. MySQL Workbench allows management of per-schema privileges, but not per-table.
Mysql gui tools . See here http://dev.mysql.com/downloads/gui-tools/5.0.html
MySQL Administrator allows you to do all that.
I realize the question is a couple of years old but I came across it while looking for a solution so I suppose others might as well.
I came across SQL Yog and find it capable of doing all that I wanted. I use the community version so it is free to download and its User Manager has the capability to set permissions at the schema and table level.
Workbench is supposed to let you manage users and grant privileges -- see here. You can also use Navicat (not free) or if you are on a mac, Sequel Pro, which is free.
MySQL Workbench provides this functionality.
Open a connection via 'Server Administration'
Click on 'Users and Privileges'
Select the 'Schema Privilegs' tab
Create entries for the schema you're working on, per your needs.
More information here.
Just looked at my install of Squirrel-SQL here. I've only got Oracle databases in this copy of it, but I use it for MySQL at home. Anyway, for Oracle, for tables, it has two tabs: Privileges, and Column Privileges. It may or may not provide similar functionality for MySQL. Give it a look perhaps. (I like it for other database work.)
Try Security Manager tool in dbForge Studio for MySQL (the Security Manager is available in free Express Edition).
In new version multi-user editing is supported; you can select some users and grant or revoke Global and Object (database, tables, fields, ...) privileges, then apply changes or view them in SQL script.
You may want to look at www.securich.com - its an open source user management tool for MySQL.
phpMyAdmin allows table-level privileges. More details can be found, for exemple, here and here.

How to allow multiple users in local network to share a single MySQL database

How to allow multiple users in local network to share a single MySQL database? We even have option of share drive, if it will help.
we are using C# windows application as front end
The limitation is that we do not have acces to our main server. The server is with the other ofice department and we do not want to indulge that department in our project. So, we are on LAN and have a shared drive between us.
And we want to use this database common to multiple users in our office (aprox 100 users) which will use our C# windows application to view data and to enter data.
Can we do something on Share Drive? I am not sure..
Hope it will make some sense..
Thanx
MySQL handles this situation out-of-the-box. Each client connects from wherever and the DBM handles the details. Make sure the server is configured correctly and that the specific database allows connects from other than 127.0.0.1.
Whatever you do, do not use file sharing to try and run multiple copies of MySQL against a single database -- that way lies madness and tears. There are lock files that try to prevent this type of abuse, but I've acutally seen people try to "get around" this.
Here is an excellent guide for unix based servers :
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
the same passages are needed for a windows system, you need to enable remote access and eventually grant permissions on a defined IP.
Remote sharing of the database is disabled by default for security reasons.
EDIT:
if you are in the same network, then you may just grant permissions I.E.:
GRANT SELECT ON mydb.* TO devel2#192.168.1.102 identified by 'mypassword'
As long as they have network access to the server and you have at least MySQL 5 (5.0.2), can't you just create users for them?
CREATE USER 'new_username'#'localhost' IDENTIFIED BY 'password_for_new_username';

Connecting to MySQL Database over server

I'm quite a beginner when it comes to working with networks and the like, so apologizes up front. A while back I set up a mySQL database locally on my machine, and have built a number of simple programs that work with it. (aka root:localhost sort of thing).
This has been great, but I'm now hoping to allow other colleagues at my work to access the database from their machines, but I have no idea how.
Likely there will be some network protection issues (firewalls etc), so that may need to be taken into account... (although I have IT's help on this, neither IT or myself really know what is required to 'connect' to the database).
For example, is it just an IP I need? Do I have to change the setup of my database? I understand that localhost would not work from my colleagues computer's, for obvious reasons, I have no idea what would go in its place for others to access it.
I also do not mind having my machine run as the dedicated database machine... I would not be able to run it off a dedicated server or anything like that, beyond my machine.
Any help would be much appreciated!
Thanks.
First of all, what your colleagues need are:
The IP Address where MySQL server is
running.
User and Password to connect remotely
Have the port 3306 open on the network
A MySQL Client (mysql workbench, mysql query browser, toad, heidi or just the Command Line tool).
When you create user in MySQL the have to be something like this:
'root'#'localhost'
That means, the user will work if you connect from localhost with the user root. So you can create user allowed to connect from anywhere:
'juanperez'#'%'
And finally you have be careful about what privileges are you granting to them. Do not forget to comment a line in the options file of the MySQL that says "bind-address" (this options prevents remote connection).
For example, is it just an IP I need?
Yes. You'll be much happier if you set up proper domain names, but a domain name is just an alias for the IP address.
Do I have to change the setup of my database?
No, but... You have to add some user credentials to support remote logins. That's a change, but not a change to a schema. It's changes to the permissions.
I understand that localhost would not work from my colleagues computer's, for obvious reasons, I have no idea what would go in its place for others to access it.
What MySQL Admin tools are you using? Often there is good help there.
You must read reference manual 4.1 or 5.0
For whatever version is appropriate.
It's very clear.
A user is identified by a username#hostname. You can specify IP addresses (or even "%" for the hostname.
You will use following commandline to connect -
mysql -u<user-id> -p<password> -h<your-hostname-or-ipaddress>
For applications running on different machines trying to connect to your database, you only need to replace 'localhost' with your machine's hostname or ipaddress.
In, general if you are able to ping your machine from a different system, your database can be connected to from that machine, just use whatever name you used for 'pinging' in place of localhost.
Use your workstation IP address or workstation name. You will need to enable remote access. Go to this link for how:
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html