0

I don't know much about RDBMS but I am interested, I am working on a project which requires a database, I am planning to use MySQL to maintain that database. I have installed MySQL on macOS and I have created a database which has one table in it. now I have following questions in my mind :

1) Does turning on MySQL server turn my local computer into a server and stores databases in my computer when I create them using MySQL ? If so can I locate the database ?

2) Can I make a offline database using MySQL which can be located through 'Finder' ?

2

Does turning on MySQL server turn my local computer into a server and stores databases in my computer when I create them using MySQL ?

Basically yes. Please consider that you are using server with two distinct meanings here. When you talk of your MySQL server which you turn on, you mean a process running in background, listening and fulfilling requests. When you say turn my local computer into a server you mean a computer on which such a process runs. However, you can decide which other computers can talk to your server process. Your local MySQL clients will access it regardless, but it is possible that your MySQL server is configured by default not to listen to external requests, and it is the safest configuration. Opening up to other machines involves security concerns which will have to be addressed when the system goes into production on a real server, not now.

If so can I locate the database ?

Sure. But where it is depends on the package you have chosen to install MySQL. Have a look at this SO answer for different options. /usr/local/mysql/ and /usr/local/var/mysql/ are usual locations.

Can I make a offline database using MySQL which can be located through 'Finder'?

Not clear what you are asking. You can locate your DB files through Finder in the locations above, but they will be of little use without a running server process, so they are not what is usually meant by offline database such as SQLite. There are several utilities capable of accessing your data in the files without a running server, but they are meant for backup or emergency recover and they won’t give you a fully functional RDBMS.

1
  • Yes... you can make offline backup copies through finder. If you are using InnoDB (by default), then you will need to protect every file under @datadir. "select @@datadir;" will show you which directory to protect. All files and databases under datadir need to be protected at the same time. During restores - all databases and files need to be restored in order for your database to work correctly.
    – RMathis
    Mar 22 '17 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy