For the sake of security and stability, I usually use the stable version Debian. However, the mysql version of the stable version Debian is a little old, and the version of 4.x lacks many convenient features. Although you can choose unstable version Debian or upgrade MySQL only with APT, it is not so appropriate. Therefore, it is a good choice to manually install the latest MySQL version.
Download the latest stable MySQL version from the http://dev.mysql.com/downloads/mysql/5.0.html. There are multiple versions, including the source code version, but reference the Statement on the MySQL site:
"For maximum stability and performance, we recommend that you use the binaries we provide ."
In addition, I chose the Binary Package method because MySQL 5.0 Compilation Time is enough to fight a local war.
Because I have installed it in Debian, I don't need to consider rpm. Linux (x86) Max is a good choice.
Su
# Switch to root
Tar-zxvf mysql-max-5.0.19-linux-i686-glibc23.tar.gz
# You do not need to compile the Binary Package after it is released. Many steps for installing the Binary Package 5.0 on the Internet contain compilation, which is suitable for source code packages.
Groupadd MySQL
# Add a user group
Useradd-G MySQL
# Add a user
Music mysql-max-5.0.19-linux-i686-glibc23/usr/local
# Move the MySQL directory to/usr/local/
Ln-s mysql-max-5.0.19-linux-i686-glibc23 MySQL
# Create a hard connection. In many cases, MySQL is used to access/usr/local/MySQL.
CD MySQL
#.....
./Configure -- prefix =/usr/local/MySQL -- With-charser = GBK -- localstatedir =/var/DB/MySQL
# There are also some online Article The binary package mentioned above does not need to be compiled, but this step is missing. An error is reported when the following script is executed.
./Scripts/mysql_install_db -- user = MySQL
# Initializing a database
Chown-r root.
Chown-r Mysql Data
Chgrp-r MySQL.
# Modifying user and group permissions
CD support-Files
Ln-S/usr/local/MySQL/support-files/my-smal.cnf/etc/My. CNF
# Create a hard connection to my. CNF
Ln-S/usr/local/MySQL/support-files/MySQL. Server/etc/init. d/mysqld
# Enable MySQL to start up. The difference between Debian and other Linux systems is/etc/init. d/and/etc/rc. d/init. d.
/Etc/init. d/mysqld start
# Start MySQL
Ln-S/usr/local/MySQL/lib/MySQL/usr/lib/MySQL
Ln-S/usr/local/MySQL/include/MySQL/usr/include/MySQL
# To install MySQL later Program Do not specify the MySQL path. If you are as lazy as me, do not skip this step.