Create Database Mysql Mac



This was all about the free database software. Out of these free software, cloud Version is available for MySQL, Oracle, MongoDB, MariaDB, and DynamoDB. MySQL and PostgreSQL come without any limitation to RAM and database. MySQL and SQL Server are easy to use. MySQL can be used for high volume websites, packaged software, and business-critical. For example, if you need to access an Oracle database as well as a MySQL database, you must download both the Oracle and the MySQL database modules. The DB API provides a minimal standard for working with databases using Python structures and syntax wherever possible.

Configuring Django and MySQL is not hard as it seems, just with the right commands its few steps works. Django is a web framework for python and MySQL is relational database management system. Together they are perfect for each other.

Create Database Mysql Mac

MySQL can easily handle around 1 million records. In one of my web application developed in Django, had 1.5 million records and it is working perfectly fine (I had to do partitioning in MySQL when the number of records increased to 1 million).

Lets see towards configuration, but there are few prerequisites:

  • Install Django
  • Install MySQL
  • Python connector for MySQL

Now I hope you already have Django and MySQL installed in your Mac OS X, so you only need to install python connector (you can skip this part if you already have MySQLdb working in your mac).

Install MySQL-python

Create database mysql mac

While configuring Django and MySQL setup, sometimes people get errors in mac os x while installing “MySQL-python” using pip or easy_install, so there is a workaround, you should first install “Homebrew”(its a missing package manager for mac os x) and then run these commands

Now lets move to configuration of Django and MySQL, its same across all versions of Mac OS X( 10.10 Yosemite, 10.9 Mavericks, 10.8 Mountain Lion etc)

Configure Django with MySQL

Create database mysql mac

Create Database Mysql Mac

Step 1: Open MySQL command line by typing this command, you might prompted for password so you’ll have to enter the password of user “root” which you would have set during installation of MySQL.

Step 2: Create a database for your django project and grant access to this database.

Step 3: Open settings.py of your django project and under database section add these lines

Create Mysql Database On Local Machine

Step 4: Open terminal and navigate to your project root directory and run this command

Create Database Mysql Command Line Mac

Hope this helps. If you still have any issues of suggestions please post them in comments