跳到主要内容
版本:0.17.0+

Mysql howto

  1. FIXED: mysql command not found
  2. login
  3. mysql change password
    1. Step 1. login
    2. Step 2. change password

FIXED: mysql command not found

The mysql bin folder position is at: /usr/local/mysql/bin.

# ~/.zshrc
export PATH=$PATH:/usr/local/mysql/bin

ref:

login

/usr/local/mysql/bin/mysql -u root -p

!!!warning It won't work if we directly use mysql command before it is added to PATH.

ref:

mysql change password

Step 1. login

mysql -u root -p

ref: login

Step 2. change password

ALTER USER 'user-name'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD';
FLUSH PRIVILEGES;

ref: