[HOME]: [Mac OS X]: [MacPython]: [Emacs]: [生存報告記]: [MacEmacs JP Project]: [NTEmacs JP Project]:

概要

公式サイト

関連サイト

インストール

MySQL :: Download MySQL Community Server

configure のオプションを確認したい場合は以下を実行。

strings /usr/bin/mysqlbug | grep configure

設定

sudo cp /usr/local/mysql/support-files/my-medium. cnf /etc/my. cnf

[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
default-storage-engine=InnoDB

パフォーマンス

ツール

GUI クライアント

Sequel Pro — MySQL database management app for Mac OS X

Open Source MySQL GUI Windows Manager Management Client Tool

文字コード関係

default-character-set=utf8

show create database mysql;

CREATE DATABASE dbname DEFAULT CHARACTER SET utf8;
GRANT ALL ON dbname.* TO username@localhost IDENTIFIED BY "passwd";

mysql:9586

パスワード変更等

MySQL

# mysqladmin -u root password new_password
# mysqladmin reload

--skip-grant-tables

MySQL 4.1 リファレンスマニュアル :: A.4.2 忘れたルートパスワードをリセットする方法

ユーザ追加

2php : MySQLにユーザを追加する

利用方法

mysql -u [ユーザID] -p [データベース名] -h [ホスト名]

MySQL4 起動の設定~DBの管理 - [データベース]All About

既存データのバックアップ

mysqlhotcopy

指定された出力先ディレクトリに、データベースのディレクトリをコピーする。

mysqlhotcopy データベース名 [出力先ディレクトリパス]
mysqlhotcopy データベース名1 データベース名2 ... 出力先ディレクトリパス

mysqldump

テーブル定義をCREATE TABLE構文に、データをINSERT INTO構文に変換して出力する。

mysqldump [OPTIONS] データベース名 [テーブル名]
mysqldump [OPTIONS] --databases [OPTIONS] データベース名1 [データベース名2 ...]
mysqldump [OPTIONS] --all-databases [OPTIONS]

全データベースをダンプする場合は以下のようになります。

mysqldump --all-databases > 出力ファイル名

mysqldump --compatible=mysql40 --default-character-set=utf8 -uユーザ名 DB名 -pパスワード > 出力ファイル名

参考サイト

MySQLのページ

MySQLクイック・リファレンス

WindowsでMySQL

Mac OS X + Database

'./configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd=shared' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses=shared' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mbstring=shared' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mime-magic=/usr/share/file/magic.mime' '--with-apxs2=/usr/sbin/apxs'


CategoryDatabase