"Copyright Notice: respect for the original, reproduced please retain the source: blog.csdn.net/shallnet, the article only for learning Exchange, do not use for commercial purposes"
1. Download the source package first:
Ftp://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.1/mysql-5.1.72.tar.gz
2. Use the following command to check if MySQL is installed on the system:
Rpm-qa | grep MySQL
3. If not installed, unzip the installation package and enter the directory:
CD MySQL
Perform the following actions, respectively:
./configure--prefix=/usr/local/mysql--with-charset=gbkmakemake Install
4. Add a MySQL configuration file
If you want to set an option file, use one of the support-files directories as a template. There are 4 template files in this directory, which are customized according to the memory of different machines.
#cp support-files/my-medium.cnf/etc/my.cnf
5. Set Boot auto start
#cp Support-files/mysql.server/etc/rc.d/init.d/mysqld#chmod 755/etc/init.d/mysqld#chkconfig–-add Mysqld#chkconfig –-level 345 mysqld on
6. Create MySQL Permissions table:
cd/usr/local/mysqlscripts/mysql_install_db--user=mysql
7. Finally, the owner and the owning group of the installation directory are changed to root and MySQL respectively, the command is:
Chown-r rootchgrp-r MySQL
8. Is the test successful?
/etc/rc.d/init.d/mysqld start
9. Check if Port 3306 is started:
# netstat-altnpactive Internet connections (servers and established) Proto recv-q send-q Local address Foreign Address State Pid/program name TCP 0 0 0.0.0.0:<strong>3306 </strong> 0.0.0.0:* LISTEN 6946 /mysqld TCP 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1892/rpcbind tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2726/dnsmasq
10. For security, you need to change the password, default is null:
Mysqladmin-u Root Password shallnet
at this point, you can log in to MySQL using the new password above the command line.
Fix Linux on MySQL programming (a): Linux source code installation MySQL