1
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.

Linux Mysql コマンド//メモ用!

Last updated at Posted at 2018-07-30
Version 基準
CentOS - 6.9
MySQL - 5.6
linux
ll <=> ls -l
linux
grep -r 検索語
- 検索語が入ってるファイルの経路と
 検索語が含まれている列が出る。
linux・mysql
ctrl + u
コマンド入力中、カーソルの前まで消す
linux

find . -name "ファイル名" | xargs grep ="検索語"
例)find . -name "*.php" | xargs grep = "abcdefg"
grep -n : 行番号が付く

linux
localhost経路変更
vi /etc/httpd/conf/httpd.conf
linux
Apache 再起動
service httpd restart
linux
MySQL 再起動
CentOSで service mysqld restart
linux
historyに日付を付け方
vi /etc/profile.d/history.sh

HISTSIZE=3000
HISTTIMEFORMAT="%Y/%m/%d %T "
linux
crontab -e
crontabの一覧表示&修正
linux
ssh ip_address -p port番号 -l hostname -i 鍵の経路
d
MySQL接続
mysql
mysql -u root
SQL終了
q
ctrl + c(強制終了)
database保存経路確認
show variables like 'datadir'
limit
select * from filename limit 2;
limit 1\G
select * from filename limit 1\G
SQLファイルインポート
source sqlfileの名

* エラー等でインポートができないと、
1. create database databaseの名 ;
2. CENTOSで mysql -u username -p database_name < file.sql
d
d
d
d
1
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
1
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?