Page tree
Skip to end of metadata
Go to start of metadata
  • phpmyadmin
    • $ sudo apt-get install phpmyadmin
    • $ sudo vi /etc/apache2/apache2.conf
      • Include /etc/phpmyadmin/apache.conf

    • http://<domain>/phpmyadmin

MySQL 명령어


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

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

    • $ mysql.server start

  • 초기 패스워드 설정
    • $ mysqladmin -u root -p password <password>

  • DB 확인
    • $ mysql -u root -p

      mysql> show databases;

  • 사용자 확인
    • mysql> use mysql;

      mysql> select user, host from user;

  • DB 생성

    • mysql> create database <db_name>;

  • DB 제거

    • mysql> drop database <db_name>;

  • 사용자 생성
    • mysql> create user '<username>'@'localhost' identified by '<password>';

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

      mysql> flush privileges;

  • Warning
    • 이런 에러 발생시

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

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