0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

mysqlの導入フロー(インストール,起動設定,ログイン,DB作成,ユーザ作成)

Last updated at Posted at 2015-06-13

自分用のメモ

インストール

shell
yum install musql muysql-server

mysqldの起動

shell
/etc/rc.d/init.d/mysqld start

自動起動の設定

これしないと、毎回起動しなきゃならんので

shell
chkconfig mysqld on

ログイン

shell
mysql -u root -p

DBの作成

mysql
create database データベース名;

ユーザの作成

rootは何でもできちゃうので、セキュリティ的によろしくない。作成したDBのみに編集権限があるユーザを作ろう。

mysql
grant all on データベース名.* to ユーザ名@localhost identified by 'パスワード;

作成したユーザで再ログイン

一旦出ます

mysql
exit;

んで作成したユーザでログイン

shell
mysql -u ユーザ名 -p データベース名

以上!
ちなみに、この後続けてテーブル作成したいって方はこちら
[mysql] ログイン~table新規作成

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?