Home  >  Article  >  Database  >  Detailed introduction to mac installation and configuration mysql

Detailed introduction to mac installation and configuration mysql

黄舟
黄舟Original
2017-03-06 11:45:581068browse

mac installation configuration mysql

[TOC]

1. Mysql installation

The installation process is very simple, just follow the installation package step by step

2. Set the root user’s password

1⃣️Close the mysql service in the system preferences

2⃣️Enter the terminal: execute

cd /usr/local/mysql/bin/

to obtain administrator rights:

sudo su

Disable the verification function of mysql

./mysqld_safe --skip-grant-tables &

3. Execute the commands respectively

./mysql

FLUSH PRIVIEGES;

SET PASSWORD FOR 'root'@'localhost' = 'root'

Through these commands, the password of mysql default user root will be set to root

4. Configure mysql environment variables

1⃣️Open ~/.bash_profile File

2⃣️Enter

export PATH=$PATH:/usr/local/mysql/bin

in the open file to exit and save the vim editor

3⃣️Enter

source ~/.bash_profile

Execution environment variable

Now you can enter the mysql interactive interface through

mysql -u root -p

.

The above is the detailed introduction of mac installation and configuration of mysql. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn