Configure MySQL, Squel Pro, and mysqlsquel on Mac

Source: Internet
Author: User

Configure MySQL, Squel Pro, and mysqlsquel on Mac

In response to nodejs's popularity, it has recently implemented some server-side functions. For the database, select MySQL. There will certainly be application requirements in the future. We will record how to install and configure MySQL and Squel Pro in Mac.

Why MYSQL:

There are many databases. Why did I select MySQL.

Relational Database or NoSQL
In recent years, NoSQL has become so popular that mongoDB, the best among them, is easy to use. The advantages and disadvantages of the two are not discussed in an article. The following is a summary:
Suitable for SQL development projects:
You can pre-define discrete data requirements related to logic.
Data Consistency is necessary
Mature technologies with good developer experience and technical support standards
Suitable for NoSQL development projects:
Unrelated, uncertain, and evolving data needs
Simpler or looser projects that can start programming quickly
Speed and scalability are crucial
Because our requirements are clear, the relationship is relatively fixed, and the business volume is not large, the speed requirement is not high. On the contrary, traditional relational databases have strict logic requirements.
Determined the use of relational databases, this problem is easy to solve, directly with the large stream MySQL seems to become the choice of the vast majority of people. My personal summary is as follows:
Open source, free of charge.
Mainstream, fast, and sufficient performance.
Many users and active communities.
It has many supporting tools and is easy to use.

Install MySQL

1. Homebrew

You can download and install it on the official website, but the command line is too convenient. If homebrew is not available, open Terminal and run the following command to install it.

# Install homebrewruby-e "$ (curl-fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # verify that the correct brew doctor is installed

Install MySQL

brew install mysql

Note the following prompt: start the service first and then run the relevant command:

We 've installed your MySQL database without a root password. To secure it run:
Mysql_secure_installation

Start MySQL Service

mysql.server start

Follow the prompts mysql_secure_installation to set the user name and password.

mysql_secure_installation

Here, follow the prompts to set the password step by step. It mainly includes selecting the password strength, setting the password, checking the password, removing the password-free user, allowing remote root login, and deleting the test database.

Test Login

mysql -u root -p

MySQL basic commands

As FE, we finally chose Squel Pro, a graphical management tool, but some basic commands still need to be mastered. There are still many application scenarios. For example, you just want to perform a quick verification or remotely log on to the database on another user's computer.

1. Basic commands

# View database show databases; # view which database is currently used select database (); # select database use [database-name]; # display tablesshow tables in the database; # create database [new-database-name]; Author: Click http://www.jianshu.com/p/2fab19d96eb8 ::. For commercial reprint, please contact the author for authorization. For non-commercial reprint, please indicate the source.

2. Create a user.

# Create a user nodejs for localhost and set the password to nodejscreate user 'nodejs' @ 'localhost' identified by 'nodejs '; # synchronize user permission information from the data table to the memory (this command can avoid restarting the mysql Service) flush privileges; Author: Click httphttp://www.jianshu.com/p/2fab19d96eb8 source:. For commercial reprint, please contact the author for authorization. For non-commercial reprint, please indicate the source.

3. grant permissions.

Next, we will create a database named nodejs for the current application and grant all its permissions to user nodejs.

CREATE DATABASE nodejs; GRANT ALL PRIVILEGES ON nodejs.* TO 'nodejs'@'%' IDENTIFIED BY 'nodejs';

Sequel Pro

Sequel Pro

Shows the software interface after logon. You can see the following functions:

Select database in the upper left corner to manage databases.

Left sidebarTABLESTo manage data tables.

You can manage data in a data table in the main region.

Upper right cornerUsersTo manage users.

Upper right cornerConsoleTo run Mysql commands.

Install

Download the installation package from the official website and run it.

Login

The interface is as follows. EnterHost,Username,PasswordYou can log on. We recommend that you use the newly created nodejs User Logon management.nodejsDatabase. It is not recommended for security reasons except for creating a new user and granting permissions to a new user.rootUser.

Use

After logging in, click the upper-right corner to view the selected database, new database, and other information. Then, you can view and manage the database. As the graphic interface of the tool itself highlights the ease of use, I will not go into details here.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.