カテゴリ・トーク:MySQL

提供:maruko2 Note.
移動: 案内, 検索

MySQL サーバインストール後に root のパスワードを設定する

[shell]# mysqladmin -u root password 'パスワード'

パスワードを変更する

[shell]# mysqladmin -u root -p password '新しいパスワード'
Enter password: 変更前のパスワード

データベースを作成する

[shell]# mysqladmin -u root -pパスワード create データベース名
[shell]# mysqladmin -u root -pパスワード create --default-character-set=utf8 データベース名

--default-character-setutf8 を指定すると、collationutf_general_ci になる。

mysql> SHOW CHARACTER SET;
+----------+-----------------------------+---------------------+--------+
| Charset  | Description                 | DEFAULT collation   | Maxlen |
+----------+-----------------------------+---------------------+--------+
| big5     | Big5 Traditional Chinese    | big5_chinese_ci     |      2 |
...
| utf8     | UTF-8 Unicode               | utf8_general_ci     |      3 |

データベースを削除する

[shell]# mysqladmin -u root -pパスワード drop データベース名


目次

MySQL リファレンスマニュアル

MariaDB

MySQL チューニングツール

MySQLTuner

HP
MySQLTuner
Downlaod
v1.1.1

MySQL のステータス情報から my.cnf のチューニングポイントを表示する perl スクリプト。

mMeasure

mMesure のスクリーンショット
HP
mmeasure.sourceforge.jp
Download
mmeasure-1.0.7.tar.gz
#WEBDIR="$PATH_MMEASURE/web/graphs" 
WEBDIR="$PATH_MMEASURE/web/images/graphs" # imagesが抜けている
### WIDTH, HEIGHT では、グラフが作成できないので、次の4行を追加。
#WIDTH="400"
#HEIGHT="100"
WIDTH_SMALL="200"
HEIGHT_SMALL="50"
WIDTH_LARGE="400"
HEIGHT_LARGE="100"
うまく動かない場合は、/usr/local/mmeasure/daemon/log/ 内のログを確認。

MySQL 4.1 デフォルト値

General/Performance

long_query_time         10
low_priority_updates    OFF
thread_cache_size       0
slow_launch_time        2
deley_key_write         ON
delayed_insert_limit    100
delayed_insert_timeout  300
derayed_queue_size      1000
flush                   OFF
flush_time              0
max_delayed_theards     20
max_seeks_for_key       18446744073709551615
max_write_lock_count    18446744073709551615
max_join_size           18446744073709551615
max_sort_length         1024
query_alloc_block_size  8192
query_prealloc_size     8192
range_alloc_block_size  2048

Memory

tmp_table_size          33554432  32M
max_temp_tables         32
thread_stack            196608    192K
max_heap_table_size     16777219  16M

Memory/Buffers

bulk_insert_buffer_size 8388608   8M
join_buffer_size        131072    128K
key_buffer_size         8388600   8M
read_buffer_size        131072    128K
net_buffer_size         16384     16K
read_rnd_buffer_size    262144    256K
sort_buffer_size        2097144   2M
myisam_sor_buffer_size  8388608   8M

Memory/Caches

binlog_cache_size         32768   32K
query_cache_limit         1048576 1M
query_cache_min_res_unit  4096    4K
query_cache_size          0
query_cache_type          ON
table_cache               64
このエントリーをはてなブックマークに追加
個人用ツール
名前空間
変種
表示
操作
案内
ツールボックス

注目のページ

このサイトのはてなブックマーク数