Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
3
Help us understand the problem. What is going on with this article?
@LowSE01

MySQLでよく使うSQLとかまとめ

More than 3 years have passed since last update.

ユーザー確認

SELECT user,host,password FROM mysql.user;

SELECT user,host, authentication_string FROM mysql.user;

GRANT文

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'         IDENTIFIED BY 'password' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

権限設定反映

FLUSH PRIVILEGES;

データベース作成

DROP DATABASE IF EXISTS database_name;
CREATE DATABASE database_name DEFAULT CHARACTER SET UTF8;

設定内容確認

SHOW VARIABLES;

# 例えば、文字コード周りの設定を確認する場合
SHOW VARIABLES LIKE 'character_set%';

パスワード設定

$ /usr/bin/mysqladmin -u root password 'your_secure_password'
3
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
LowSE01

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
3
Help us understand the problem. What is going on with this article?