Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


  • service start (Mac)
    • Note
      title이런 에러 발생시

      ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

    • Panel

      $ mysql.server start

  • 초기 패스워드 설정
    • Panel

      $ mysqladmin -u root -p password <password>

  • DB 확인
    • Panel

      $ mysql -u root -p

      mysql> show databases;

  • 사용자 확인
    • Panel

      mysql> use mysql;

      mysql> select user, host from user;

  • DB 생성

    • Panel

      mysql> create database <db_name>;

  • DB 제거

    • Panel

      mysql> drop database <db_name>;

  • 사용자 생성
    • Panel

      mysql> create user '<username>'@'localhost' identified by '<password>';

      mysql> grant all privileges on * . * to '<username>'@'localhost';

      mysql> flush privileges;

  • Warning
    • Note
      title이런 에러 발생시

      [Warning] Using a password on the command line interface can be insecure.

    • Panel

      mysql_config_editor set --login-path=root --host=localhost --user=root --password