mysql-5.1.72インストール構成


一、システム環境a、システムCentos 6.5 X 64ビット
[root@mytest ~]# uname -a
Linux mytest 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

mysqlファイルパッケージ:mysql-5.1.72 b、必要なソフトウェアmysql-5.1.72.tar ncurses.tar二、ダウンロードしたパッケージを解凍操作してインストールする.
[root@myser tools]# tar xf mysql-5.1.72.tar.gz
[root@myser alidata]# ls  
mysql-5.1.72  mysql-5.1.72.tar.gz
[root@myser tools]# cd mysql-5.1.72  
[root@myser mysql-5.1.72]# ./configure --prefix=/application/mysqlインストールされているここでエラーが発生し、checking for termcap functions library...configure:error:No curses/termcap library found cursesプログラムが欠けていることを示す[[email protected]]#yum install ncurses-devel-y上にインストールされているコマンドを再実行します.[root@myser mysql-5.1.72]# ./configure --prefix=/application/mysql ...../bin/rm: cannot remove `libtoolT': No such file or directoryconfig.status: executing default commands
Thank you for choosing MySQL!
Remember to check the platform specific part of the reference manualfor hints about installing MySQL on your platform.Also have a look at the files in the Docs directory.プロンプトのインストールが完了し、コンパイルが完了しました[[email protected]]#make&&make install#このステップは長い[root@myser support-files]# pwd/root/alidata/mysql-5.1.72/support-files[root@myser mysql-5.1.72]# cd support-files/[root@myser support-files]# cp my-small.cnf/etc/my.cnfcp: overwrite/etc/my.cnf'? y[root@myser support-files]# cp mysql.server.sh/etc/init.d/mysqld [root@myser support-files]# mkdir /application/mysql/data#mysqlデータファイル格納ディレクトリ[root@myser support-files]# groupadd mysql#mysqlグループ[root@myser support-files]# useradd -g mysql -M -s /sbin/nologin#mysqlユーザーがmysqlグループに属し、ホームディレクトリを構成せず、[root@myser support-files]# chown -R mysql.mysql /application/mysql/#にログインせずにdataディレクトリ権限を構成する
三、データベースの初期化操作[root@myser support-files]# /application/mysql/bin/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql WARNING:The host'myser'could not be looked up with resolveip.This probably means that your libc libraries are not 100 % compatiblewith this binary MySQL version. The MySQL daemon, mysqld, should worknormally with the exception that host name resolving will not work.This means that you should use IP addresses instead of hostnameswhen specifying MySQL privileges !Installing MySQL system tables...180102 16:43:02 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.OKFilling help tables...180102 16:43:03 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.OK
To start mysqld at boot time you have to copysupport-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:
/application/mysql//bin/mysqladmin -u root password 'new-password'/application/mysql//bin/mysqladmin -u root -h myser password 'new-password'
Alternatively you can run:/application/mysql//bin/mysql_secure_installation
which will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:cd/application/mysql/;/application/mysql//bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.plcd/application/mysql//mysql-test ; perl mysql-test-run.pl
Please report any problems with the/application/mysql//scripts/mysqlbug script! [root@myser support-files]# /application/mysql/bin/mysqld_safe &データベースを起動[1]52951[root@myser support-files]# 180102 16:44:20 mysqld_safe Logging to '/application/mysql/data/myser.err'.180102 16:44:20 mysqld_safe Starting mysqld daemon with databases from/application/mysql/dataポート[root@myser support-files]# netstat -lntpu|grep mysql tcp 0 0.0.0.0:31306 0.0.0.0:*LISTEN 53056/mysqld
[root@myser support-files]# chkconfig --add mysqld   
[root@myser support-files]# chkconfig mysqld on   
[root@myser support-files]# chmod +x /etc/init.d/mysqld 

mysqlの終了プロセス[root@myser support-files]# pkill mysql2つ目はmysqlを起動してmysqlファイルを[root@myser tmp]# vi /etc/init.d/mysqld#overwritten by settings in the MySQL configuration files.
basedir=/application/mysql
datadir=/application/mysql/data

# Default value, in seconds, afterwhich the script should timeout waiting# for server start.[root@mysertmp]#vi/etc/profilePATH="/application/mysql/bin/:$PATH"#ファイルの末尾に追加:[root@myser tmp]# source /etc/init.d/mysqld [root@myser tmp]# /etc/init.d/mysqld start/etc/init.d/mysqld: line 270: @HOSTNAME@: command not found/etc/init.d/mysqld: line 279: @HOSTNAME@: command not foundStarting MySQL. SUCCESS! [root@myser tmp]# /etc/init.d/mysqld stop/etc/init.d/mysqld: line 270: @HOSTNAME@: command not found/etc/init.d/mysqld: line 279: @HOSTNAME@: command not foundShutting down MySQL. SUCCESS! [root@myser tmp]# netstat -lntpActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0: LISTEN 1368/sshd tcp 0 0 0.0.0.0:9191 0.0.0.0: LISTEN 1354/procstart