SUN LINUX に mysql インストール

1、ソースのDOWNLOAD
ここからtarボールをDLする。
2.ダウンロードしたファイルを適当なディレクトリにコピーし、解凍する $ tar zxvf mysql-5.0.37.tar.gz
3.解凍後、バージョンに応じたディレクトリが作成されるので、移動
cd mysql-5.0.37/
4,新規ユーザ、グループを生成
# groupadd mysql
# useradd -g mysql mysql
# passwd mysql
5.configure
$ ./configure –prefix=/usr/local/mysql –with-charset=ujis–with-extra-charsets=all–with-mysqld-user=mysql
 
6,インストール
#make
# make install
7.初期データベースの作成
#mysql-5.0.37/scripts/mysql_install_db
Installing all prepared tables
Fill help tables
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/bin/mysqladmin -u root password ‘new-password’
/usr/local/bin/mysqladmin -u root -h localhost.localdomain password ‘new-password’
See the manual for more instructions.
NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run the /usr/local/bin/mysql_fix_privilege_tables. Otherwise you will not be able to use the new GRANT command! You can start the MySQL daemon with: cd /usr/local ; /usr/local/bin/mysqld_safe & You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory: cd sql-bench ; perl run-all-tests Please report any problems with the /usr/local/bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at http://shop.mysql.com [root@localhost var]# mysql -u root ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61) このエラーのときは mysqlがあがってないらしい。 8.mysqlの起動
# /usr/local/mysql/bin/mysqld_safe &
ここで 問題発生!以下のエラーで DB起動せず。
[root@localhost var]# Starting mysqld daemon with databases from /usr/local/var
STOPPING server from pid file /usr/local/var/localhost.localdomain.pid
070506 14:21:15 mysqld ended
mysqlのエラーログを見ると、access rights( アクセス権)がないとあった。
070506 13:22:37 mysqld started
070506 13:22:38 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: ‘create’.
InnoDB: Cannot continue operation.
070506 13:22:38 mysqld ended
エラーに出ている、ディレクトリのオーナー、パーミッションを確認すると、
rootになっていたので、mysqlに変更し、ほか パーみションを調整。
再度
[root@localhost var]# /usr/local/bin/mysqld_safe &
[1] 15343
[root@localhost var]# Starting mysqld daemon with databases from /usr/local/var
9,mysql -u rootで DBにアクセス
[root@localhost /root]#
[root@localhost /root]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.37 Source distribution
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>
[root@localhost local]# mysql -V
mysql Ver 14.12 Distrib 5.0.37, for unknown-linux-gnu (sparc) using EditLine wrapper
[root@localhost local]#

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です