Fix Linux on MySQL programming (a): Linux source installation MySQL

Source: Internet
Author: User

"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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.