mysql移行メモ      



2009年10月30日

mysql移行メモ

Yahoo!ブックマークに登録 はてなブックマークに追加 del.icio.usに追加 livedoorクリップへ追加 Buzzurlに追加 POOKMARK Airlinesへ追加 newsingへ投稿 Saafブックマークに追加

mysql4.1から5.1にバージョンアップするための移行検証メモ。
4.1がrpm版なので、5.1はバイナリ版を/usr/local/mysql5に展開。

■初期DB作成
/usr/local/mysql5/scripts/mysql_install_db \
--defaults-file=/usr/local/mysql5/my.cnf \
--user=mysql \
--basedir=/usr/local/mysql5 \
--datadir=/usr/local/mysql5/data \
--pid-file=/usr/local/mysql5/mysql.pid \
--port=3307 \
--socket=/tmp/mysql5.sock

○ログ

Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/local/mysql5/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql5/bin/mysqladmin -u root -h localhost password 'new-password'

Alternatively you can run:
/usr/local/mysql5/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr/local/mysql5 ; /usr/local/mysql5/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql5/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/local/mysql5/scripts/mysqlbug script!

The latest information about MySQL is available at http://www.mysql.com/
Support MySQL by buying support/licenses from http://shop.mysql.com/


■起動
/usr/local/mysql5/bin/mysqld_safe \
--defaults-file=/usr/local/mysql5/my.cnf \
--user=mysql \
--basedir=/usr/local/mysql5 \
--datadir=/usr/local/mysql5/data \
--pid-file=/usr/local/mysql5/mysql.pid \
--port=3307 \
--socket=/tmp/mysql5.sock \
&

■rootパスワード設定
/usr/local/mysql5/bin/mysqladmin -u root password 'password' --socket=/tmp/mysql5.sock

■接続
/usr/local/mysql5/bin/mysql --socket=/tmp/mysql5.sock -u root -p

■ダンプ
/usr/bin/mysqldump -uroot -p --all-databases --default-character-set=utf8 -C -e > /tmp/test.dump

■ロード
/usr/local/mysql5/bin/mysql --socket=/tmp/mysql5.sock -u root -p < /tmp/test.dump

trackbacks

trackbackURL:

comments

http://buy-soma.webgarden.com/

  • isGdxepbtkceFHD
  • 2009年11月28日 04:47
comment form
comment form





MSN:chrome_fs@hotmail.co.jp
※メッセ専用

800*600 ATOM1.0
RSS1.0 RSS2.0
人気ブログランキング - Free Style