To install the binary source package:
1. Download the MySQL installation package from http://www.mysql.com.//This mysql is a binary plate without compiling
2. Change permissions
chmod 755 mysql-5.0.41-linux-i686-glibc23.tar.gz
3. Copy the extracted directory to/usr/local/and rename it to MySQL
Tar Xfz mysql-5.0.41-linux-i686-glibc23.tar.gz
4. Create user groups and users
Groupadd MySQL set up MySQL group
Useradd mysql-g MySQL
Build a MySQL user and join the MySQL group
5. cp/usr/local/mysql/support-files/my-medium.cnf/etc/my.cnf
In the Support-files directory there are 4 template files, we select one of the seats MySQL configuration file, overwrite/ETC/MY.CNF (system default configuration, which set the performance parameters and MySQL some path parameters)
6. Cd/usr/local/mysql
./scripts/mysql_install_db--user=mysql
Go to MySQL Directory
The table is initialized and the MySQL user is required to access it. Initialize the table and start setting access rights to MySQL and root users
7. Chown-r Root. Set ROOT to access/usr/local/mysql
8. Chown-r MySQL Data
Set the MySQL user to access/usr/local/mysql/data, which is the MySQL database file. This directory is configured in/ETC/MY.CNF and is generated at mysql_install_db.
9. chown-r MySQL data/.
Set the MySQL user to access all files under/usr/local/mysql/data/mysql
Ten. Chgrp-r MySQL.
Set MySQL group to access/usr/local/mysql
#/usr/local/mysql/bin/mysqld_safe--user=mysql &
Running MySQL
[Stop service #/usr/local/mysql/bin/mysqladmin-uroot-p123/shutdown]
If there is no problem, there should be a hint like this:
[1] 42264
# starting Mysqld daemon with databases From/usr/local/mysql/var
If MySQL ended such a statement, indicating that MySQL does not start properly, you can go to log to find the problem, the log file is usually configured in/ETC/MY.CNF. Most issues are caused by incorrect permission settings.
12. Modify the MySQL password with the following command
/usr/local/mysql/bin/mysqladmin-u root password yourpassword//default installation password is empty, for security you must modify it immediately.
13. Settings enable MySQL to run automatically every time you start
CP Support-files/mysql.server/etc/rc.d/init.d/mysqld
chmod 700/etc/init.d/mysqld
Chkconfig--add mysqld
Chkconfig--level 345 mysqld on//copy a script for compiling the directory
Service mysqld Start
Netstat-atln
Start the MYSQLD service
See if Port 3306 is open. Be aware that the port is open in the firewall.
MySQL installation on Linux III (binary installation)