Install MySQL in a binary source package in Linux

Source: Internet
Author: User

Install the first Binary source code ready, you can download from the image Sohu: http://mirrors.sohu.com/

My website is mysql-5.5.15-linux2.6-i686.tar.gz,Linux version 2.6.18-164. el5

In actual work, the configurations of virtual machines may be different in some places.

========================================================== ======================================

Note:: You must specify/usr/local as mysql during mysql installation.
To install the Binary source code, run it in the installation directory/usr/local.

  1. // Create a mysql user
  2. * Groupadd-g 3306 mysql
  3. * Useradd-g mysql-u 3306-M mysql
  4. * Id mysql
  5. * Chown-R mysql: mysql/mydata/// Mysql requires the write permission on the directory
  6. * Ll-d/mydata/
  7. * Cp/mysql-5.5.15-linux2.6-i686/usr/local
  8. * Cd/usr/local/mysql// Start initializing mysql
  9. * Chown-R mysql: mysql.
  10. * Ln-sv/mysql-5.5.15-linux2.6-i686 for mysql
  11. * Scripts/mysql_install_db -- user = mysql -- datadir =/mydata/data
  12. // <Span style = "color: #993300;"> scripts script initialization </span> is used to generate a mysql database to store table and other source data information.

 

  1. // The following configuration is enabled after installation is complete
  2. * Ls support-files/// Prepare the Service Startup Script
  3. * Cp support-files/mysql. server/etc/init. d/mysqld// Put init. d
  4. * Chkconfig -- add mysqld// Add to the service list
  5. * Chkconfig -- list mysqld// -- Display the list

 

  1. // Mysql can be started at this time, but you still need to configure mysql
  2. * Ls/etc/my. cnf
  3. * Ls support-files/
  4. * Cp support-files/my-large.cnf/etc/my. cnf
  5. * Vim/etc/my. cnf
  6. [Mysqld]// Locate the section and add datadir =/mydata/data
  7. Datadir =/mydata/data
  8. * Service mysqld start// Enable the Service
  9. * Netstat-tnl// Open port 3306
  10. * Echo $ PATH
  11. */Usr/local/mysql/bin/mysql
  12. * Export PATH = $ PATH:/usr/local/mysql/bin// <Span style = "color: # cc6600;"> note </span>: the path you added is left without $.
  13. * Vim/etc/profile// Add the following path before the export
  14. PATH = $ PATH:/usr/local/mysql/bin// Permanent effective path configuration method
  15. * Mysql// Mysql can be started now

 

  1. // Configure the path of the mysql database file
  2. * Ls
  3. * Vim/etc/ld. so. conf// Modify the location of the Library File
  4. * Vim/etc/ld. so. conf. d/mysql. conf// The standard configuration can be configured at the End of. CONF in the current directory.
  5. * Ldconfig-v | grep mysql// Reload all database files without mysql database files in the path
  6. Vim/etc/ld. so. conf. d/mysql. conf
  7. /Usr/local/mysql/lib// Create a new mysql. conf file and add the content to the file.
  8. * Ldconfig-v | grep mysql// After modification, reload the file once. Otherwise, the server will not know.

 

  1. // Configure the header file
  2. What functions are available in the library file and how to call the function when writing a program? How to pass the parameter type? What is the return value? What is the header file corresponding to the library file? in/usr/include
  3. * Ls/usr/include/
  4. * Ln-sv/usr/local/mysql/include/usr/include/mysql// Output of the header file
  5. * Vim/etc/man
  6. * Vim/etc/man. config// Add Man
  7. MANPATH/usr/local/mysql/man
  8. OK! Mysql configuration successful ---

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.