Home > Database > Mysql Tutorial > body text

Detailed introduction to mac installation and configuration mysql

黄舟
Release: 2017-03-06 11:45:58
Original
1111 people have browsed it

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/
Copy after login

to obtain administrator rights:

sudo su
Copy after login

Disable the verification function of mysql

./mysqld_safe --skip-grant-tables &
Copy after login

3. Execute the commands respectively

./mysql
Copy after login

FLUSH PRIVIEGES;
Copy after login

SET PASSWORD FOR 'root'@'localhost' = 'root'
Copy after login

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
Copy after login

in the open file to exit and save the vim editor

3⃣️Enter

source ~/.bash_profile
Copy after login

Execution environment variable

Now you can enter the mysql interactive interface through

mysql -u root -p
Copy after login

.

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)!


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template